Workflow Triggered Twice
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2023 06:17 AM
Hi Team,
I have created one UI action 'Request Approval' , When we click on this it will trigger the associated workflow. Below is the script for same .
var wflw = new global.Workflow();
wflw.startFlow(wflw.getWorkflowFromName('workflowName'), current, current.operation());
but it was triggering the same workflow twice with few seconds diff. find the below snap of workflow properties.
Kindly check and help on this....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2023 06:36 AM
There is no condition on your Workflow, it was triggered once through your UI Action script and another directly once record is created or triggered.
Alternative solution.
When you click UI Action 'Request Approval', you must be updating any field value like Approval = Requested.
Instead of triggering Workflow through UI Action script, why not trigger it based on condition Approval is Requested. This will not trigger it twice.
Thanks
Anubhav Ritolia
ServiceNow Rising Star 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2023 11:07 PM
Hi @AnubhavRitolia ,
i have tried with your solution, i have updated the workflow conditions and removed start workflow from script but still it was triggering twice, One by User and one by the system.