How can i call UI Action in workflow

Rama26
Tera Contributor

Hi,

i created ui button and this ui button display when description data updated as failed in RITM. i need to call that ui button in workflow. 

How many times the user click on resubmit button i need to start the workflow procedure from starting.

 

10 REPLIES 10

Service_RNow
Mega Sage

Hi,

1. https://developer.servicenow.com/dev.do#!/reference/api/sandiego/server_legacy/c_WorkflowAPI#r_WF-st...

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

2. Workflow need trigger condition to trigger,so you can give trigger condition by UI Action so workflow will trigger by UI Action.

If you have any hidden string field in your form then push some value on them and give this value as workflow trigger condition.

if not then in push any string field as below...

 

find_real_file.png

 

find_real_file.png

 

it will definitely work ...

if face any issue then please ask..!

 

Mark correct or helpful if it helps you.

instead of using ui action, is it not possible in workflow

please explain the requirement? 

Rama26
Tera Contributor

Ram,

Used below script 

triggerWorkflow();

function triggerWorkflow(){

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

}

but workflow not triggered when i click on ui button.