Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have been using the Qlik Sense API Script that was so helpfully been put together in this thread:
Have had no problems in most of my usages, but for my current project I have two connections that sit inside my NPrinting app and both are needed in the report output.
When i run the script, only one of the connections refreshes before publish job gets triggered. I do not have much knowledge on API's within Qlik, is it possible to refresh ALL connections associated with an app before running publish task?
Kind Regards,
Stephen
Yes its possible, just a GET to /connections with a filter on appId and then a loop for all fetched connectionIds towards POST /connection/{id}/reload.
I havn't read the post you refering to, but why do you need to update NP metadata everytime you run the NP task?
sure it is possible.. Just change your script to loop through connection id's and launch all of them..
I wrote subroutines to do that:
https://nprintingadventures.com/2019/04/08/nprinting-api-qlik-rest-subroutines/
all what you will need to do is to configure variables and call it like:
// Authenticate
Call NP_Authenticate;
Drop Table cookie_items;
// Get App
Call NP_GetAppID('$(vNPrintingAppName)')
Drop Table apps_items;
// Get and Reload All Connections
Call NP_ConnectionReload
// Get Task
Call NP_GetTasks('here put task name')
// Trigger Tasks
Call NP_TriggerTasks
Drop tables
task_items,
connection_items,
_post_items
;
once configured it is super easy to maintain various scenarios with reloads and you have a lot more parameters you can control
On the other hand - why do you need to reload connection metadata when you using Qlik Sense? With Qlik Sense it is not required at all unless you are doing development changes in your model.
@blaise just noticed your post - and exactly the same train of thoughts! 🙂 haha