I want to trigger a flow from client side UI action?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-03-2020 03:07 AM
Hi,
I want to trigger a flow from client side UI action. Then when I creating a flow trigger should be given. Is there any way that without giving a trigger for the flow and initiating from UI action.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-03-2020 03:20 AM
Hi there,
You could call a subflow from a UI Action. The UI Action being the trigger. Would that work for you?
See for example:
https://developer.servicenow.com/dev.do#!/learn/learning-plans/orlando/servicenow_application_develo...
Here example code of what I used for one of our cases:
function() {
var inputs = {};
inputs['some_subflow_input'] = 'some value';
var outputs = sn_fd.FlowAPI.executeSubflow('flow_name', inputs);
action.setRedirectURL(current);
})();
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP
---
LinkedIn
Community article list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-03-2020 03:21 AM
Hi Mounika,
you can use GlideAjax script in your Client Side UI Action and refer below link on how to trigger flow from script
use that code in your script include function
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-03-2020 03:34 AM
Hi Ankur,
I know the script to trigger a flow. But when I creating the flow it is asking for trigger when I have given trigger in that flow it is automatically triggered when a record met the condition.But I want to trigger the flow only from UI action. In that case , what I should give as the trigger in flow

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-03-2020 03:39 AM
Go for a subflow instead of a flow.
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP
---
LinkedIn
Community article list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field