Can we execute flow designer using business rule script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-17-2023 08:04 AM
I want to execute flow designer using Business rule on Import set table. Is it possible to execute, if yes can someone help me on business rule script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-17-2023 08:14 AM
Hi @manoj1 ,
You can use the flow API in your business rule, here's an example from the official docs
// 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);
refer to this doc: https://developer.servicenow.com/dev.do#!/learn/learning-plans/tokyo/servicenow_application_develope...
You don't even need to write the code yourself, every flow generates the code snippet which you can leverage in your scripts.
Open the flow which you want to call and click on more action button (...), select create code snippet
It will generate a code which you can copy and use in your script, example:
If my answer has helped with your question, please mark it as correct and helpful
Thanks,
Karan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-17-2023 08:42 AM
Hi karan,
what should I provide in
inputs['current'] = ;
can you pleases help me
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-17-2023 08:17 AM
Hi @manoj1 ,
Yes, we can flow from a Business Rule script. Please find the below Docs Link
Simply you can open the respective Flow Designer and go to the create code snipper make sure you activated your flow copy the code snippet and paste it into the BR.
For more information you can visit this URL
Please mark my answer as helpful and accept it as a solution, if it helps you.
Thanks & Regards,
Suma.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-17-2023 08:50 AM
HI @manoj1 ,
I trust you are doing fine.
Yes, it is possible to execute Flow Designer using a Business Rule on the Import Set table. In order to help you with the business rule script, please provide more details about the specific actions or conditions you want to trigger the Flow Designer execution. This will allow me to assist you more effectively in creating the script.
Was this answer helpful?
Please consider marking it correct or helpful.
Your feedback helps us improve!
Thank you!
Regards,
Amit Gujrathi