Qlik Community

Qlik NPrinting Discussions

Discussion Board for collaboration on Qlik NPrinting.

Announcements
Qlik Analytics Tour 2020 Online. Begins August 10th. Register Today
cancel
Showing results for 
Search instead for 
Did you mean: 
Master III
Master III

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!!!

2 Solutions

Accepted Solutions
Highlighted
Support
Support

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

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

We are just 'like' you & like to be liked when we provide a helpful answer and or when you press the 'Solution Accepted' button if an answer provided resolves your question or issue... Cheers!

View solution in original post

Highlighted

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

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
Highlighted
Support
Support

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

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

We are just 'like' you & like to be liked when we provide a helpful answer and or when you press the 'Solution Accepted' button if an answer provided resolves your question or issue... Cheers!

View solution in original post

Highlighted

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

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