Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Unveils New Agentic Capabilities Across Analytics, Data Engineering, and Trust: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
ylchuang
Contributor II
Contributor II

Issue using variable in REST URL with GET method (works with POST)

Hi all,

I’m struggling with a strange behavior when using variables in the REST Connector URL with the GET method.

 

What works

If the URL variable is a static string, the REST call works as expected:

 

set vURL=https://mktorest.com/bulk/v1/leads/export/abc123/file.json;

LIB CONNECT TO 'Marketo File';

RestConnectorMasterTable:
SQL SELECT 
	"company",
    "email",
    "firstName",
    "lastName"
FROM CSV (header on, delimiter ",", quote """") "CSV_source"
			WITH CONNECTION (
            			URL "$(vURL)"						
);

 

What does NOT work

If the URL variable is built using another variable, the REST call fails, even though the resolved URL is identical.
let vExportID='abc123';
set vURL=https://mktorest.com/bulk/v1/leads/export/$(vExportID)/file.json;

TRACE vURL: $(vURL);

LIB CONNECT TO 'Marketo File';

RestConnectorMasterTable:
SQL SELECT 
	"company",
    "email",
    "firstName",
    "lastName"
FROM CSV (header on, delimiter ",", quote """") "CSV_source"
			WITH CONNECTION (
            			URL "$(vURL)"						
);

 

  • The TRACE log shows the exact same URL string as the hard‑coded version.
  • The same variable pass‑through works when the REST call uses POST, but fails with GET.
  • The REST connection has “Allow WITH CONNECTION” enabled.
  • No query parameters are involved. The variable is part of the URL.
  • Using SET and LET have the same outcome.

Is this a known limitation or quirk of the Qlik REST Connector with GET request?
Thanks in advance!

Labels (2)
12 Replies
ylchuang
Contributor II
Contributor II
Author

I feel quite silly, after adding a pause of a few minutes between POST and GET, the files can be retrieved via GET.

But since Qlik doesn't seem to have a native pause function, I split the loading script into two apps and schedule them with some minutes apart.

I think it is also possible to check status first and then load, but the chance of it happening is quite low, so I will just simply schedule them with enough buffer time.

marksouzacosta

Hi @ylchuang

Awesome! Good to hear that.
There is a native pause function in Qlik. It is called Sleep. This is the reference: https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/Scripting/ScriptRegularS...

Regards,
Mark Costa

Read more at Data Voyagers - datavoyagers.net
Follow me on my LinkedIn | Know IPC Global at ipc-global.com

ylchuang
Contributor II
Contributor II
Author

Great! Didn't know about Sleep function. 

Let me rework my app a bit.

Thanks again for the great help, Mark!