Trigger ServiceNow workflow from ui action?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-23-2018 07:29 AM
I am getting started with workflows in ServiceNow. I can see that the trigger for workflow is based on conditions. But can a workflow be triggered by some sort of user action? ie. i created "Form link" on incident form and i need to trigger a work flow when form link on the incident form is clicked.
Also i read in many articles that we have to pass input variables to the workflow, so need to know if we have to run workflow on clicking form link what would be the input variables to workflow and how do we pass it ?
Many thanks in advance.
Thank you,
Manish
- Labels:
-
Event Management
-
Orchestration (ITOM)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-23-2018 07:37 AM
Yes, you can create a UI that triggers a workflow. You can pass the workflow variables by referring to the form fields with "current.field_name." You can also create your own variables and assign values to them and pass them to the workflow.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-23-2018 08:23 AM
Yes you can do all sorts of operations on the workflow using workflow api

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-24-2018 12:44 AM
Hello John & Abhinay,
Many thanks for your support.
it still dint work me.PFB piece of code which i added to ui action.
var w = new Workflow();
var context = w.startFlow('3D73a371814f121300bf0aeb118110c715', current, current.operation(), getVars());
function getVars() {
var vars = {};
vars= current.cmdb_ci.getDisplayValue();
return vars;
}
i am using vars as input to workflow .
Could you guys please help me here.
Thank You,
Manish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-31-2018 01:48 AM
Hi Manish,
Plaese go through the below link
https://community.servicenow.com/community?id=community_question&sys_id=af22db21db101fc01dcaf3231f96191d
Mark if helpful
Warm Regards,
Devyani