Run async script include from UI Action

m_23
Giga Contributor

Hello,

Ran into a bit of a performance issue today and the cause seems to be a UI Action calling a long running script include, resulting in the UI Action timing out.  

We are working on a scoped application and would like to get the UI Action to process the script include asynchronously to avoid performance impact to the client session.   Any suggestions on how this can be achieved would be greatly appreciated!

Thanks!

Matt

1 ACCEPTED SOLUTION

I would suggest using an async business rule if it is an integration. UI action are mainly for instant actions. You should be able to do a glide ajax from UI action, if you mark the UI action client. But the best practice it to use an async business rule which will improve the performance significantly.



Please mark this response as correct or helpful if it assisted you with your question.

View solution in original post

8 REPLIES 8

SanjivMeher
Kilo Patron
Kilo Patron

Hi Matt,



What are you trying to achieve by calling a script include from UI action?



Are you updating the current table or some other tables using UI action?



Can you achieve it using a business rule or client script?



Please mark this response as correct or helpful if it assisted you with your question.

m_23
Giga Contributor

Hello Sanjiv,



The UI Action collects a large dataset from a 3rd party application, the script include captures the data and inserts/updates various tables, all different from the table the UI Action is being run from.



Could potentially utilize a business rule - is there a drawback or is it not possible to get a UI Action to run a script include asynchronously?



Thanks,


Matt


I would suggest using an async business rule if it is an integration. UI action are mainly for instant actions. You should be able to do a glide ajax from UI action, if you mark the UI action client. But the best practice it to use an async business rule which will improve the performance significantly.



Please mark this response as correct or helpful if it assisted you with your question.

I second Sanjiv on this.


You can simply call the Script Include from the async business rule.



ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022