Skip to main content
Applications are open for the 2024 Qlik Luminary Program. Apply by December 15 here.
Showing results for 
Search instead for 
Did you mean: 
Contributor III
Contributor III

Dynamically Load Items

Hi all, 

I have the following script:

LIB CONNECT TO 'REST_sample_connection';

Let j=0;

for j = 0 to 10

Let vID = peek('ID', $(j), 'Data_Details');

SQL SELECT (I removed the details here as they are not important)


FROM JSON (wrap on) "root" PK "__KEY_root"
URL "",
QUERY "filter" " eq '$(vID)'",
HTTPHEADER "Authorization" "Bearer $(vToken)"

next j;

DROP TABLE RestConnectorMasterTable;

Data_Details is a table I load before that, which has a field with 10 IDs. What I want to do in the script above is to perform the above load with a filter on each of these 10 IDs. 

Any ideas why my script doesn't work? 

Labels (1)
3 Replies
Creator II
Creator II

What is the error that you get when you try to load the script?

Contributor III
Contributor III

Hi Rachel,

No error, but it just doesn't load anything from this table where I apply the logic above. 

If I put a specific ID instead of the variable in the filter, it works with no issue. 

Any ideas what might be done wrongly in the above logic? 

Creator II
Creator II

The issue might be that the filter needs a number rather than a string, try this instead:

QUERY "filter" " eq $(vID)",