Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

delay in ui action button after clickin on it

mr_Bhaskar
Tera Contributor

i have an ui action button in my workspace when i click on that it is activating after some delay in the work space how can i remove that delay

1 ACCEPTED SOLUTION

@mr_Bhaskar 

the delay is because of this line, in this line you are calling subflow and using inForeground() so it will wait till the time subflow completes and then the next line will execute

I believe you want it to run in foreground because based on response you are doing something.

var flow_result = sn_fd.FlowAPI.getRunner().subflow('x_simet_cmdb.deactivate_sims').inForeground().withInputs(inputs).run();

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

6 REPLIES 6

mr_Bhaskar
Tera Contributor

so the delay is common we cannot remove that?

 

@mr_Bhaskar 

the delay will depend on how quick your subflow runs.

If you don't want to wait for subflow output you can use background function "inBackground"

var flow_result = sn_fd.FlowAPI.getRunner().subflow('x_simet_cmdb.deactivate_sims').inBackground().withInputs(inputs).run();

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader