Multiple RITM need to be generated based on number of options selected in the list collector variabl
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2024 02:48 AM
Hi Community,
I have a requirement, in catalog form there is list collector variable if i select 3 options then 3 ritms needs to be created under the request.
How can we achieve this
Thanks in advance
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2024 05:38 AM
Hi @suuriya ,
Please have a look at this community post -
Create multiple RITM under single request dependin... - ServiceNow Community
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2024 05:49 AM
HI @Anirudh Pathak ,
Thanks for this article but can you let me know how we can achieve this using CartApi....im looking for this
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2024 06:55 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2024 05:59 AM
Hi @suuriya, You can try with the 'GlideappCalculationHelper'. If you are using the workflow, you need to write the script in run script activity or if you are using the flow designer, then you may need the script action where you need to write the script.
var catItemId = "<catalogItemSysId>";
var requestId = current.request;
var listCollector = current.variables.<your_list_collector_name>.toString().split(',');
for (var i = 0; i < listCollector.length; i++){
var helper = new GlideappCalculationHelper();
helper.addItemToExistingRequest(requestId, catItemId, "1");
}
Regards,
Sunil