Connectivity & Data Prep

Discussion board where members can learn more about Qlik Sense Data Connectivity.

Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!

Who Me Too'd this solution

Ilhui
Contributor II
Contributor II

I got the solution in stackoverflow and wanted to post it in here in case someone else runs on the same situation.

The WITH CONNECTION part can alter some parameters of the connection but not all of them. The http parameters can be changed there like: the url, headers, query parameters and the body. You cant change the rest like: the method (get or post), timeout, http protocol etc. These properties are connection specific and they have to be updated on connection level (when manually editing an connection or updating it via Repository API)

Have a look at the documentation about the WITH CONNECTION keyword

btw the QUERY command will just add a query parameter in the url before sending the request. And thats why you are not getting any data. For example

let vURL = 'http://example.com'

RestConnectorMasterTable:
SQL SELECT 
    ...my fields to query from Service NOW...
FROM JSON (wrap off) "result" PK "__KEY_result"
WITH CONNECTION (
URL "$(vURL)",
QUERY "type" "XML",
QUERY "subtype" "text"
);

will alter the url before sending it and the actual url will be http://example.com?type=XML&subtype=text

you can (should?) split each query param like this: QUERY "definition" "Gavel Sub-State Duration", QUERY "sysparm_fields" "id,sys_id,start,end,value,definition", QUERY "1sysparm_display_value" "false"

 

Here's the link for more  reference: https://stackoverflow.com/questions/63175850/dynamic-rest-connection-to-service-now-in-qlik-sense 

View solution in original post

Who Me Too'd this solution