Issue calling a Flow Action repeatedly from the same form

Anubhav24
Mega Sage
Mega Sage

Hi All,

 

I have created a UI Action as form link and in this UI Action I am calling a flow action using sn_fd.flow_api now when a user opens up the RITM form where this UI Action is presented as a form link , it works fine the first time user clicks on the form link and it performs the intended action but if I click on this form link again after updating the associated catalog task, the respective flow action is not getting executed , however if I search this RITM again and then click on this form link it works fine.

 

I tried adding location.reload() , this did not work for me.

 

Any suggestions on how to fix this?

6 REPLIES 6

JenniferRah
Mega Sage

Are you calling a Flow or a Flow Action? If you're calling a Flow Action, you shouldn't have any issues with it running multiple times. There is a setting in Flows, though, in the trigger that would need to be set to run "For each unique change" if it needs to be run more than once.

 

JenniferRah_0-1746100744186.png

 

If you really are running a Flow Action, then I would look to see if the action is getting fired off but then immediately stopping for some reason.

 

Hi @JenniferRah ,

I am calling my custom flow action in my UI Action script like "sn_fd.FlowAPI.<flow_action_name>".

For this , on flow action properties we do not have run as system setting.

Ankur Bawiskar
Tera Patron
Tera Patron

@Anubhav24 

reloading should not be an issue and updating some record and then coming back and clicking works, that also should not have any dependency

share your script

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

Ankur Bawiskar
Tera Patron
Tera Patron

@Anubhav24 

your UI action code should be like this so that it reloads the form after triggering the flow action

I assume your UI action is server side

// your code here to start flow action

action.setRedirectURL(current); // reloads the form

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