Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Defect acknowledgement with Nprinting Engine May 2022 SR2, please READ HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
Digvijay_Singh

Nprinting REST API in Qlik Sense Script - How to trigger multiple tasks

Hi,

I followed this below link but not sure how to add multiple tasks in the 'vPublshTaskURL'

https://community.qlik.com/t5/Qlik-NPrinting-Discussions/How-to-use-Qlik-NPrinting-APIs-inside-a-Qli...

 

If anyone has triggered multiple nprinting tasks from Qlik Sense script , please share the URL format.

I tried like below but its throwing invalid ID error - 

 

Let vTaskId = '$(vTaskId1)'&','& '$(vTaskId2)' &','&'$(vTaskId3)'&','&'$(vTaskId4)';

let vPublshTaskURL = 'https://nprint.premisehealth.com:4993/api/v1/tasks/'&'$(vTaskId)'&'/executions';
//Exit Script;
DROP TABLE RestNPTasksMasterTable;

//********************************************************
//NP POST Task execution
//********************************************************
LIB CONNECT TO 'NPrinting POST REST Connector';

RestNPTaskTriggerTable:
SQL SELECT
"__KEY_data"
FROM JSON (wrap off) "data" PK "__KEY_data"
WITH CONNECTION( URL "$(vPublshTaskURL)", HTTPHEADER "cookie" "$(vCookie)");

[_post_items]:
LOAD [__KEY_data] AS [__KEY_data]
RESIDENT RestNPTaskTriggerTable
WHERE NOT IsNull([__KEY_data]);

DROP TABLE RestNPTaskTriggerTable;

Thanks in advance!!!

Labels (2)
2 Solutions

Accepted Solutions
Frank_S
Support
Support

Hi @Digvijay_Singh 

There is a QVF in this article (scroll to the bottom of the page) which contains code allowing you to execute all Publish tasks in a Single NPrinting App.

https://support.qlik.com/articles/000059611

Please remember hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!

View solution in original post

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Feel free to use my library to do this. It makes the setup much easier and works "quite out of the box"

cheers

Lech

https://nprintingadventures.com/2019/04/08/nprinting-api-qlik-rest-subroutines/

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.

View solution in original post

2 Replies
Frank_S
Support
Support

Hi @Digvijay_Singh 

There is a QVF in this article (scroll to the bottom of the page) which contains code allowing you to execute all Publish tasks in a Single NPrinting App.

https://support.qlik.com/articles/000059611

Please remember hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Feel free to use my library to do this. It makes the setup much easier and works "quite out of the box"

cheers

Lech

https://nprintingadventures.com/2019/04/08/nprinting-api-qlik-rest-subroutines/

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.