Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
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.
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?
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.
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.
Note HEADER should be HTTPHEADER (at least in QSE 3.2 and above)
I have an issue too.
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
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!