Query Graphql with download tool
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi. I'm trying to query Tableau's Graphql API through the download tool with the following payload.
It works (pic 1), and returns a list of workbooks. The problem arises when I want to add a filter to the query (pic2):
Pic(1):
Pic(2):
I cannot for the world figure out how to add the filters correctly. The query, with filter, runs fine directly in the Graphiql browser editor (pic3).
Pic(3):
In Alteryx the query needs to be written as a json object.
Please help :p We are going nuts over this.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Similarly running into trouble with this - not sure why the filtering doesn't work!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
i think the quotes around your luid throws off your json. I'd try swapping out single and double quotes to show clear separation between key value pairs in the query and the query itself.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Finally figured this out! The way the string is passed via JSON doesn't work with the double quotes. You need to add backslashes like the below example (which reads in a list of projects to call for).
'{
"query": "query workbookFields {workbooks(filter: {projectName:\"'+[ProjectName]+'\"}) {name,projectName,embeddedDatasources {fields {name,isHidden,__typename},upstreamTables {name,schema,database{id,name,luid,connectionType},upstreamDatabases{name}}}}}"
}'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I was able to get this to work by using just the query part of the GraphQL syntax in the Formula tool and using the "Compose Query String/Body"..."And values from these fields" section in the Payload tab of the Download tool.
My formula looks like this...
and my Download tool (Payload tab) looks like this...
Only have Authorization in the Headers tab and https://api.monday.com/v2 as the url.
