<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Qlik Sense load script trigger NPrinting task through API, intermittently getting 0 rows task_name from NPrinting in Integration, Extension &amp; APIs</title>
    <link>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-load-script-trigger-NPrinting-task-through-API/m-p/2546940#M22836</link>
    <description>&lt;P&gt;Reference from this article by&amp;nbsp;&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/48712"&gt;@Frank_S&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://community.qlik.com/t5/Qlik-NPrinting/How-to-Trigger-NPrinting-Task-from-Qlik-Sense-App-or-Task/td-p/2014140" target="_blank" rel="noopener"&gt;https://community.qlik.com/t5/Qlik-NPrinting/How-to-Trigger-NPrinting-Task-from-Qlik-Sense-App-or-Task/td-p/2014140&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Best Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Nelson&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 15 Apr 2026 08:22:36 GMT</pubDate>
    <dc:creator>NelsonOng</dc:creator>
    <dc:date>2026-04-15T08:22:36Z</dc:date>
    <item>
      <title>Qlik Sense load script trigger NPrinting task through API, intermittently getting 0 rows task_name from NPrinting</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-load-script-trigger-NPrinting-task-through-API/m-p/2546931#M22834</link>
      <description>&lt;P&gt;&lt;SPAN&gt;We have an app that runs in Qlik Sense to trigger NPrinting task, which is chained to a main app, meaning once the main app runs finish, this NPrinting trigger API task will then run to trigger the NPrinting tasks. We have been experiencing frequent failures&amp;nbsp;of the NPrinting Trigger Tasks recently. This works well most of the time but once it fails, the NPrinting task has to be recreated.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;-Retrieved 0 rows when retrieving task_name from NPrinting tasks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Recreating the task in NPrinting resolved the problem. However, the same issue has continued to occur intermittently on other tasks, and this workaround is not a sustainable solution for us.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;QS Script as below:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;vURL is being maintained in excel.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;LIB CONNECT TO 'NPrinting Rest Login (GET)';

RestConnectorMasterTable:
SQL SELECT
"Set-Cookie",
"__KEY__response_header"
FROM JSON "_response_header" PK "__KEY__response_header";

Let vCookieRaw = Peek('Set-Cookie',0,'cookie_items');
Let vCookie = TextBetween(
vCookieRaw,
'SameSite=None,',
' Path=/',
SubStringCount(vCookieRaw,'SameSite=None')-1
);


LIB CONNECT TO 'NPrinting Rest Login (GET)';

RestNPTasksMasterTable:
SQL SELECT
"__KEY_data",
(SELECT
"id",
"name",
"enabled",
"__FK_items"
FROM "items" FK "__FK_items")
FROM JSON (wrap off) "data" PK "__KEY_data"
WITH CONNECTION(
URL "$(vURL_1)",
HTTPHEADER "cookie" "$(vCookie)"
);
TRACE **$(vURL_1) **;



[task_items]:
LOAD
[id] AS [tasks_taskId],
[name] AS [tasks_taskName]
RESIDENT RestNPTasksMasterTable
WHERE NOT IsNull([__FK_items])
//AND [enabled] = 'True'
AND [name] = 'Sales Report - 01';

LET vTaskCount = NoOfRows('task_items');

IF $(vTaskCount) = 0 THEN
TRACE *** ERROR: NPrinting task not found! ***;
EXIT SCRIPT 1;
ENDIF;

DROP TABLE RestNPTasksMasterTable;



LET vNumberTasks = NoOfRows('task_items');

FOR i = 0 TO vNumberTasks - 1

LET vTaskId = Peek('tasks_taskId', i, 'task_items');
LET vTaskName = Peek('tasks_taskName', i, 'task_items');

TRACE Triggering NPrinting Task: $(vTaskName);

LET vPublishURL =
'$(vURL_1)' &amp;amp;
'$(vTaskId)' &amp;amp;
'/executions';

// REST Connection (POST)
LIB CONNECT TO 'NPrinting Rest Connection (POST)';

RestNPTaskTriggerTable:
SQL SELECT "__KEY_data"
FROM JSON (wrap off) "data" PK "__KEY_data"
WITH CONNECTION(
URL "$(vPublishURL)",
HTTPHEADER "cookie" "$(vCookie)"
);

DROP TABLE RestNPTaskTriggerTable;

NEXT

Drop Table [task_items];



Sleep(180000);

LIB CONNECT TO 'NPrinting Rest Login (GET)';

RestConnectorMasterTable:
SQL SELECT
"Set-Cookie",
"__KEY__response_header"
FROM JSON "_response_header" PK "__KEY__response_header";

Let vCookieRaw = Peek('Set-Cookie',0,'cookie_items');
Let vCookie = TextBetween(
vCookieRaw,
'SameSite=None,',
' Path=/',
SubStringCount(vCookieRaw,'SameSite=None')-1
);


LIB CONNECT TO 'NPrinting Rest Login (GET)';

RestNPTasksMasterTable:
SQL SELECT
"__KEY_data",
(SELECT
"id",
"name",
"enabled",
"__FK_items"
FROM "items" FK "__FK_items")
FROM JSON (wrap off) "data" PK "__KEY_data"
WITH CONNECTION(
URL "$(vURL_1)",
HTTPHEADER "cookie" "$(vCookie)"
);
TRACE **$(vURL_1) **;



[task_items]:
LOAD
[id] AS [tasks_taskId],
[name] AS [tasks_taskName]
RESIDENT RestNPTasksMasterTable
WHERE NOT IsNull([__FK_items])
//AND [enabled] = 'True'
AND [name] = 'Sales Report - 02';

LET vTaskCount = NoOfRows('task_items');

IF $(vTaskCount) = 0 THEN
TRACE *** ERROR: NPrinting task not found! ***;
EXIT SCRIPT 1;
ENDIF;

DROP TABLE RestNPTasksMasterTable;



LET vNumberTasks = NoOfRows('task_items');

FOR i = 0 TO vNumberTasks - 1

LET vTaskId = Peek('tasks_taskId', i, 'task_items');
LET vTaskName = Peek('tasks_taskName', i, 'task_items');

TRACE Triggering NPrinting Task: $(vTaskName);

LET vPublishURL =
'$(vURL_1)' &amp;amp;
'$(vTaskId)' &amp;amp;
'/executions';

// REST Connection (POST)
LIB CONNECT TO 'NPrinting Rest Connection (POST)';

RestNPTaskTriggerTable:
SQL SELECT "__KEY_data"
FROM JSON (wrap off) "data" PK "__KEY_data"
WITH CONNECTION(
URL "$(vPublishURL)",
HTTPHEADER "cookie" "$(vCookie)"
);

DROP TABLE RestNPTaskTriggerTable;

NEXT&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Seeking advise from API experts.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Nelson&lt;/P&gt;</description>
      <pubDate>Wed, 15 Apr 2026 07:27:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-load-script-trigger-NPrinting-task-through-API/m-p/2546931#M22834</guid>
      <dc:creator>NelsonOng</dc:creator>
      <dc:date>2026-04-15T07:27:12Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik Sense load script trigger NPrinting task through API, intermittently getting 0 rows task_name from NPrinting</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-load-script-trigger-NPrinting-task-through-API/m-p/2546937#M22835</link>
      <description>&lt;P&gt;Please let&amp;nbsp; me know if you have the solution too&lt;/P&gt;</description>
      <pubDate>Wed, 15 Apr 2026 08:13:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-load-script-trigger-NPrinting-task-through-API/m-p/2546937#M22835</guid>
      <dc:creator>shienya</dc:creator>
      <dc:date>2026-04-15T08:13:43Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik Sense load script trigger NPrinting task through API, intermittently getting 0 rows task_name from NPrinting</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-load-script-trigger-NPrinting-task-through-API/m-p/2546940#M22836</link>
      <description>&lt;P&gt;Reference from this article by&amp;nbsp;&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/48712"&gt;@Frank_S&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://community.qlik.com/t5/Qlik-NPrinting/How-to-Trigger-NPrinting-Task-from-Qlik-Sense-App-or-Task/td-p/2014140" target="_blank" rel="noopener"&gt;https://community.qlik.com/t5/Qlik-NPrinting/How-to-Trigger-NPrinting-Task-from-Qlik-Sense-App-or-Task/td-p/2014140&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Best Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Nelson&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Apr 2026 08:22:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-load-script-trigger-NPrinting-task-through-API/m-p/2546940#M22836</guid>
      <dc:creator>NelsonOng</dc:creator>
      <dc:date>2026-04-15T08:22:36Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik Sense load script trigger NPrinting task through API, intermittently getting 0 rows task_name from NPrinting</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-load-script-trigger-NPrinting-task-through-API/m-p/2547137#M22840</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/196581"&gt;@NelsonOng&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;first thing you need to do is to remove/comment out “where” statement which filters tasks by name and exit script at that point to preview if you are getting any tasks.&amp;nbsp;&lt;BR /&gt;also i dont see in your script if you are filtering those by app and i dont see query limit which means you only getting like top 50 tasks only.&amp;nbsp;&lt;BR /&gt;In my library from nprintingadventures blog there is query limit implemented and set to 1000 or similar. Make sure your value is big enough to bring in all tasks you have in nprinting.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;cheers&lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2026 19:11:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-load-script-trigger-NPrinting-task-through-API/m-p/2547137#M22840</guid>
      <dc:creator>Lech_Miszkiewicz</dc:creator>
      <dc:date>2026-04-16T19:11:15Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik Sense load script trigger NPrinting task through API, intermittently getting 0 rows task_name from NPrinting</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-load-script-trigger-NPrinting-task-through-API/m-p/2547142#M22841</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/1326"&gt;@Lech_Miszkiewicz&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for reaching out. But afraid that's not the issue. The WHERE clause works well and only loads the task name we want. Since we want to tag each NPrinting trigger task to a main app to run the trigger after a main app finish reloading in Qlik Sense.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Long story short: this script runs well. But will receive NoOfRows for field task_name=0 after some weeks?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Nelson&lt;/P&gt;</description>
      <pubDate>Fri, 17 Apr 2026 01:51:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-load-script-trigger-NPrinting-task-through-API/m-p/2547142#M22841</guid>
      <dc:creator>NelsonOng</dc:creator>
      <dc:date>2026-04-17T01:51:28Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik Sense load script trigger NPrinting task through API, intermittently getting 0 rows task_name from NPrinting</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-load-script-trigger-NPrinting-task-through-API/m-p/2547148#M22842</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/196581"&gt;@NelsonOng&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;apologies, I read through all comments again and I actually think problem is different and it may have something to do just with your environment or maybe we dont have enough information. Lets assume scenario:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;You run your Qlik Sense script which triggers task from NPrinting via API.&amp;nbsp;&lt;OL&gt;&lt;LI&gt;how long does this task run for?&lt;/LI&gt;&lt;LI&gt;when it runs - do you see it finishing each time in task execution panel admin of nprinting console?&lt;/LI&gt;&lt;LI&gt;when it fails via API can you still run it directly from NPrinting Admin Console?&lt;/LI&gt;&lt;LI&gt;when it fails via API what is the status of that task in NPrinting admin Console --&amp;gt;Task Execution?&lt;/LI&gt;&lt;LI&gt;What are resources of your server?&lt;/LI&gt;&lt;LI&gt;Did you observe resource consumption when taks failed?&lt;/LI&gt;&lt;LI&gt;The fact that you had to recreate task from screatch indicates to me that there may be different issue which causes NPrinting freeze or something wrong with environment.&lt;/LI&gt;&lt;LI&gt;How many tasks you are running in NPrinting in total&lt;/LI&gt;&lt;LI&gt;Are all there many parallel tasks or none?&lt;/LI&gt;&lt;LI&gt;What is the version of Qlik Sense and NPrinting&lt;/LI&gt;&lt;LI&gt;Just making sure that both run on dedicates servers with all requirements met&lt;/LI&gt;&lt;LI&gt;Just making sure that both have their respective/individual service domain account users runing services&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;We need to understand what is going on in your enviornment to know what can cause this issue&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Apr 2026 05:18:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-load-script-trigger-NPrinting-task-through-API/m-p/2547148#M22842</guid>
      <dc:creator>Lech_Miszkiewicz</dc:creator>
      <dc:date>2026-04-17T05:18:28Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik Sense load script trigger NPrinting task through API, intermittently getting 0 rows task_name from NPrinting</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-load-script-trigger-NPrinting-task-through-API/m-p/2547154#M22843</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/1326"&gt;@Lech_Miszkiewicz&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here are your answer,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. technically few minutes, depending on how many tasks i want to trigger in NPrinting.&lt;/P&gt;&lt;P&gt;2.yes, it works like a normal trigger task&lt;/P&gt;&lt;P&gt;3.yup, still able to manual run from NPrinting task execution&lt;/P&gt;&lt;P&gt;4.nothing is run, cause QS script get 0no of rows for task_name, hence it throws an error straight (script is built up that way)&lt;/P&gt;&lt;P&gt;5.high specs QS &amp;amp; NPrinting, multinode environment &amp;amp; dedicated for NPrinting&lt;/P&gt;&lt;P&gt;6. no... but it wont hit max when generating report.&lt;/P&gt;&lt;P&gt;7.yep, not sure if it's an NPrinting bug or REST API connector bug. or probably due to how the cookie is obtained then handled.&lt;/P&gt;&lt;P&gt;8.~20-30tasks&lt;/P&gt;&lt;P&gt;9.No tasks parallel, i used sleep() function in the QS trigger task script to ensure they don't run parallely &amp;amp; consume max resources of the server&lt;/P&gt;&lt;P&gt;10. qs-may 25, np-feb 25&lt;/P&gt;&lt;P&gt;11.yep, dedicated nodes on multinode environment + NPrinting own server&lt;/P&gt;&lt;P&gt;12. yep!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Nelson&lt;/P&gt;</description>
      <pubDate>Fri, 17 Apr 2026 06:42:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-load-script-trigger-NPrinting-task-through-API/m-p/2547154#M22843</guid>
      <dc:creator>NelsonOng</dc:creator>
      <dc:date>2026-04-17T06:42:17Z</dc:date>
    </item>
  </channel>
</rss>

