Flow is triggered for custom RITM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
59m ago
Requirement:
I have a Service Catalog form that contains an MRVS (Multi Row Variable Set). Once the user submits the form, for each MRVS row, a separate RITM should be created under a single Request.
Problem:
The RITMs are being generated successfully using a custom Flow Designer action for each MRVS row. However, the issue is that the Flow Context from the parent/original RITM is getting attached to the newly created custom RITMs as well. Because of this, the flow gets retriggered for the custom RITMs, approvals and catalog tasks are generated again, and the process goes into an infinite loop.
- However, after completion, the Flow Context from the parent/original RITM gets attached to the custom RITMs automatically. Due to this, the approvals and catalog tasks start triggering again from the beginning for the custom RITMs, causing the flow to loop continuously.
Expectation:
- One Request should contain multiple RITMs (one per MRVS row)
- Newly created custom RITMs should not inherit or attach to the original Flow Context
script custom action script:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
55m ago
this is the where the flow context is getting attached and again manager approval is generated
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
45m ago
Use After Insert BR or flow to run this script:
(function executeRule(current, previous /*null when async*/) {
try{
var mrvsJson = current.variables.your_mrvs_internal_name;
var parsedData = JSON.parse(mrvsJson);
for (var i = 0; i < parsedData.length; i++) {
var cart = new sn_sc.CartJS('cart_' + i);
var item = {
'sysparm_id': 'sys_id_of_catalog_item',
'sysparm_quantity': '1',
'variables': {
'variable_name': parsedData[i].mrvs_field_name
}
};
cart.orderNow(item);
}
}
catch(e){
gs.info(e);
}
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4m ago
what's the business requirement for creating multiple RITMs under same REQ?
Also the RITMs you are creating while iterating MRVS are for which Catalog item?
If same then yes the same flow will get attached to the newly created RITMs, that's OOTB behavior
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
48 seconds ago
Since they have MRSV which has module, for each module, they wanted to create a separate RITM and that ritm has approval.