Qlik Community

App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
Now Live: Qlik Sense SaaS Simplified Authoring – Analytics Creation for Everyone: READ DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Syntax to change URLs and Query Parameters using WITH CONNECTION

I have a column of URLs, in Excel: I want to load all of them.

And I may allow user to change URL query parameters via the same Excel.

I don't want to create separate Qlik Sense REST Data connections for each.

Can I use the "WITH CONNECTION"? I'm sure I can.

WITH CONNECTION keyword

The REST Connector supports the WITH CONNECTION keyword, which can be used to override URLs, query parameters and query headers in a connection. The POST body can also be overridden when the POST method has been selected for the connection. WITH CONNECTION allows you to alter some parts of a connection rather than create a separate connection.

I can find two examples:

Modifying the URL:

WITH CONNECTION(Url "http://rd-xxx-win8.rdfund.hypertek.com:1337");


Modifying the Query parameters:

WITH CONNECTION(QUERY "startAt" "$(startAt)");


But I can't see where this "WITH CONNECTION" syntax is described -- does anyone have a link? Like in Backus-Naur form which Qlik help uses for other syntaxes.


6 Replies
jonathanpoyer
Partner - Creator
Partner - Creator

‌Hi Nathaniel,

the the correct syntax is

WITH CONNECTION (

URL "new URL" ,

QUERY "param name" "param value",

HEADER "header name" "header value",

BODY "request body text"

)

The answer from Petter in the full context.

Re: With Connection statement - What are all the parameters possible?

Not applicable
Author

Thank you, maybe your answer is the best source of syntax;

I'll wait before accepting your answer as  I was hoping for a more definitive/authoritative source/documentation.

jonathanpoyer
Partner - Creator
Partner - Creator

Unfortunately there is no more information on the web currently nor on the help.

You may log a ticket in order for Qlik to update their help.

pre
Employee
Employee

Note HEADER should be HTTPHEADER (at least in QSE 3.2 and above)

slondono
Partner - Creator II
Partner - Creator II

I have an issue too.

Screenshot_2.png

It fails when i use WITH CONNECTION. I think the problem is the Header but im not sure what is exaclty the problem.

Hope you can help me

bjendrick
Contributor III
Contributor III

Qlik Sense 3.1 SR4

I've had to fight through this over the last week... our URL required 2 query parameters, both "start_date" and "end_date".  In order to get that to work successfully, I had to set values in the initial REST connection setup, allow it to verify, and save the connection.  Then in code, I had to do the following:

    FROM CSV (header off, delimiter "|", quote """") "CSV_source"

    WITH CONNECTION (

        QUERY "start_date" "$(vCurrentStartDate)",

        QUERY "end_date" "$(vCurrentEndDate)"

        );

I'm sure there's someone out there that could use this with their connections.  Good luck!