How to Trigger a Flow Designer Action using Business Rule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2019 06:23 AM
Hi,
I have an OOB Flow Designer called Add Comment of Scope ITSM Spoke when i open and click on Test and pass the Ticket number and Comments it is updating. Now i want to called this Action from a Business Rule for that i used below snippet but i am getting : Invalid GlideRecord input format found
(function executeRule(current, previous /*null when async*/) {
try {
var inputs = {};
inputs['ah_task'] = 'PRB0040025' ; // String
inputs['ah_comment'] = 'Test Comment'; // Password (2 Way Encrypted)
var outputs = sn_fd.FlowAPI.executeAction('sn_itsm_spoke.add_comment', inputs);
// Get Outputs:
// Note: outputs can only be retrieved when executing synchronously.
var output = outputs['output']; // Password (2 Way Encrypted)
gs.info(output +"Flow Designer Action");
} catch (ex) {
var message = ex.getMessage();
gs.error(message);
gs.info(message + "Flow Designer Action Not working");
}
// Add your code here
})(current, previous);
Can anyone please help me on this
- Labels:
-
flow designer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2019 06:36 AM
Hi Shaik,
Can you check below link?
https://developer.servicenow.com/blog.do?p=/post/new-in-london-new-ways-to-trigger-flows/
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
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
12-04-2019 07:11 AM
I already gone through this Ankur 😞
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2019 07:04 AM
The FlowAPI methods are intended for use in the code snippet action in the flow designer, you can't use them in business rules. You can use Flow methods, as documented at the link below, to trigger a flow from a server side script but you can't just trigger actions this way.
https://developer.servicenow.com/app.do#!/api_doc?v=london&id=FlowScoped-startAsync_S_GR
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2019 07:10 AM
Hi David,
I do see in the Docs.
https://developer.servicenow.com/app.do#!/api_doc?v=newyork&id=ScriptableFlow-executeAction