- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago - last edited 4 hours ago
Hi,
We created a MRVS < internal name : device_requests >. which contains two variables
assigned_to : reference to sys_user table
serial_number: reference to alm_asset table
we want to update Asset table record based on serial number submitted using this MRVS.
tried creating a run script in Workflow, but it returns null value.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago
try this
var source_nameArr = [];
var mrvsData = JSON.parse(current.variables.device_requests); // 'my_mrvs_name'
for (var i = 0; i < mrvsData.length; i++) {
gs.info('serial number ' + mrvsData[i].serial_number);
gs.info('assigned to ' + mrvsData[i].assigned_to);
}
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
4 hours ago
update as this, it seems you are using wrong variable name
var variable1Value = row.serial_number; // actual internal name
var variable2Value = row.assigned_to;
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
4 hours ago
try this
var source_nameArr = [];
var mrvsData = JSON.parse(current.variables.device_requests); // 'my_mrvs_name'
for (var i = 0; i < mrvsData.length; i++) {
gs.info('serial number ' + mrvsData[i].serial_number);
gs.info('assigned to ' + mrvsData[i].assigned_to);
}
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