Triggering workflow from UI action

pritimayee
Tera Contributor

Hello,

Can anyone please help me on this below requirment.

I have created a new state as Draft for change request.Created new ui action'submit request'.this button will be visible on all type change request like emergency standard and normal and the when the state is in draft.

Once click on the ui action 'submit request' the normal workflow that has been defined for all the type request will start.

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

You can use this script to trigger workflow from script

Remember UI Action should be server side

triggerWorkflow();

function triggerWorkflow(){

var wf1 = new Workflow();
wf1.startFlow(wf1.getWorkflowFromName('give the workflow name'), current, 'update');

}

I would insist if possible make the workflow trigger based on the proper condition

Regards
Ankur

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

View solution in original post

11 REPLIES 11

@pritimayee1@gmail 

Hope you are doing good.

Let me know if I have answered your question.

If so, please mark appropriate answer as correct & helpful to close the thread.

If not, please let us know if you need some more assistance.

Regards
Ankur

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

Can a similar method be used to trigger a flow in Flow Designer?

 

Thank you