Ui Action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-03-2023 09:39 PM
I have created one Button on incident form that is "Ask for approval". My requirement is when I will click on that button it triggers the flow designer which I have created for approval request. I mean it should ask for the approval to a specific person when I will click that button. How can I achieve that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-03-2023 10:06 PM - edited ‎12-03-2023 10:06 PM
You can use the API below to runs a flow from server-side script in your UI Action.
startFlow(String name, Map inputs)
Sample
// Map inputs. For a flow with a record trigger, inputs are the record and table
var inputs = {};
inputs['current'] = current; // GlideRecord of table:
inputs['table_name'] = 'incident';
// Execute the global flow called test_flow
sn_fd.FlowAPI.executeFlow('global.test_flow', inputs);
Or you can just simply build an UI Action that upon clicking, it will update the record State to specific value "Waiting for Approval".
Then in your flow, the Trigger is set as Updated and the Condition is state matching to the above value.
Cheers,
Tai Vu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-03-2023 10:14 PM
Can I use Flow deigner flow name in the executeFlow (last line)?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-03-2023 10:25 PM
HI @swati swagatika ,
I trust you are doing great.
var inputs = {};
inputs['current'] = current; // GlideRecord of the table
inputs['table_name'] = 'x_cpts_onboarding_cpts_referral_data';
// To start the flow asynchronously, uncomment the following line:
// sn_fd.FlowAPI.startFlow('x_cpts_onboarding.invite_to_apply', inputs);
// To execute the flow synchronously, use the following line:
sn_fd.FlowAPI.executeFlow('x_cpts_onboarding.invite_to_apply', inputs);
Was this answer helpful?
Please consider marking it correct or helpful.
Your feedback helps us improve!
Thank you!
Regards,
Amit Gujrathi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-03-2023 10:28 PM
How Can I use Flow designer in this script?
Can we add flow designer or only workflow?