Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
is it possible to delay the execution of triggered nprinting tasks (through api).
the situation is that i have a qlik app that reloads and ends by triggering an nprinting task https://help.qlik.com/en-US/nprinting/May2022/APIs/NP+API/index.html?page=57
the "problem" is that the nprinting task starts generating the report sometimes before the app is saved... resulting in a report containing "old" data on some sheets, and "refreshed" data on the next sheets.
Hi @mikaelsc
"i'm triggering the api call from the same app" - that will never work properly!
Yes you need to create individual apps and it may add more apps and tasks but it does not get too messy as long as you have streams and app names created with NPrinting in mind and you keep naming convention in place.
cheers
Sure @mikaelsc
I am assuming you are triggering that API call via another Qlik App script. Why dont you put in your API script SLEEP XXXX statement so script waits some time before executing any further statements:
cheers
Lech
hello.
that's what i feared... i'm triggering the api call from the same app.
(i think if i have to create a second "api_trigger" app for each app i want to use the api trigger stuff it will get very messy...)
thanks 😉
Hi @mikaelsc
"i'm triggering the api call from the same app" - that will never work properly!
Yes you need to create individual apps and it may add more apps and tasks but it does not get too messy as long as you have streams and app names created with NPrinting in mind and you keep naming convention in place.
cheers
thanks !
i couldn't let this go ;-)...
i ended up replacing the "call" api logic in each qlik sense app by a statement storing a qvd with the name of the nprinting task to trigger:
Hi @mikaelsc
This is very good as long as you are happy with this approach and it works for you. I can see what you do and frankly I have similar solution with one of my clients. The only thing I dont like about this approach is troubleshooting if something didnt run for some reason. You have to go through the logs and find out what/when didn't run...
I was contemplating the idea of having "live" register of tasks in form of QVD which in fact could be just single file with typical attributes like:
App Name | Task Name | Created | Triggered | Trigger flag |
a | a | 08/03/2024 12:12 | 08/03/2024 12:15 | 1 |
a | a | 08/03/2024 13:12 | 08/03/2024 13:15 | 1 |
a | a | 08/03/2024 14:12 | 08/03/2024 14:15 | 1 |
a | a | 08/03/2024 15:12 |
Similar to your approach instead of creating QVD with task name I would just concatenate to above table 1 line with the app name and task name to put it in the queue.
Then API trigger app would loop through the empty trigger tasks and woud update so you could see when it was run and at the same time such task would be marked as completed. You could have that table shown on UI of your API app to have full register which you can easily adit. Lastly that way you could actually have reload of this app set as a trigger from another app making it always "real time" and as long as there is a record in it it will be picked up and executed.
cheers