- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-27-2025 10:03 AM
I have one multi row variable set and it has one variable "Acquisition Method" type is select box with options "Lease" and "Purchase". and user will be edit this variable in catalog task level, not while submitting request, it's hidden while submitting the request.
If "Purchase" is selected then there are few steps, same if "lease" is selected there are other steps.
If I select multi records then also it reflects with first record.
 
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-09-2025 12:52 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-27-2025 09:33 PM
so what's your question?
what's not working?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-27-2025 09:44 PM
it is checking only 1st record and not the 2nd, it should check both, rather it should iterate through all the records.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-27-2025 10:14 PM
then use 2 flow variables to check the count of Purchase and Lease and then use Set Flow Variable logic
In the inline script you can parse the JSON from MRVS and then increment the count and then set the flow variables.
Then use IF logic to check the count of each and have your logic
Something like this
I hope I have provided enough information and you can enhance it from here
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-27-2025 11:00 PM
I tried,
var count = 0; var mrvs = fd_data._1__get_catalog_variables.add_hardware_models_for_this_request.toString(); var parsedData = JSON.parse(mrvs); for(var i=0;i<parsedData.length;i++){ if (parsedData[i].acquisition_method == 'purchase') count = count + 1; } return count;
but facing with below error
ncountered error executing instruction: OpInstruction{id=42, opClass=com.snc.process_flow.operation.script.InlineScriptOperation, io=Io{input={required_run_time=RefOrValue{value=vanilla, isRef=false}, _1__get_catalog_variables_add_hardware_models_for_this_request=RefOrValue{value=c1o.add_hardware_models_for_this_request, isRef=true}, script=RefOrValue{value=(function (inputs, outputs) {outputs.__...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-27-2025 11:51 PM
did you add logs and see?
try this
var count = 0;
var mrvs = fd_data._1__get_catalog_variables.add_hardware_models_for_this_request.toString();
gs.info('json is' + mrvs);
var parsedData = JSON.parse(mrvs);
for(var i=0;i<parsedData.length;i++){
if (parsedData[i].acquisition_method.toString() == 'purchase')
count = count + 1;
}
return count;
Did you include that MRVS variable set in the Right side of bucket in "Get Catalog Variables"
are you using correct mrvs variable set name?
are you using correct variable name present within MRVS?
are you using correct value to compare?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader