How to access to the values of a MultiRow Variable Set in a Business rules
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2023 12:19 PM - edited 04-26-2023 12:37 PM
Hi!! I need to get the values form a MultiRow Variable Set in a business rules. Because I need to populate this values (from MRVS) into a new table.
MRVS:
Business Rule:
I need to populate those values into a new table.
New table:
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2023 01:02 PM
Thats because current.variables was null. So the code ran for a record that did not have the data you were looking for. You need to do a check beforehand. Something like
var mrv = [];
if(current.variables.booking_details)
mrv = JSON.parse("" + current.variables.booking_details);
else
return;
You should find a requested item that has data in the MRV you want to mess they and then use a background script in your dev instance to test it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2024 01:58 AM
Hi I had the issue and solved it. The objects are not Json parsible , how I resolved this was I used Json stringify first.
var mrvs = JSON.parse(JSON.stringify(fd_data._2__get_catalog_variables.multi_row_var));
htmlTable += '<tr><td>Test</td><td>'+ mrvs[0].field_name + '</td></tr>';
The Field name is the Variable name in service now UI