- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2020 03:58 AM
Hi Team,
Can anyone please help , How to do Map to field on MRVS ,there is no direct option, is there anyway to achieve.
Regards,
Saridha.L.
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2020 06:11 AM
try with below code , i have added log as well. so check the log if it does not work, and let me know the log result as well
var mrvs = JSON.parse(producer.journal_entry_line_items);
var rowCount = mrvs.length;
gs.log('Length is '+ rowCount);
for (var i = 0; i < rowCount; i++) {
var gr = new GlideRecord('x_journal_entr_journal_entry');
gr.initialize();
gr.setValue('u_account', row.u_account);
gr.setValue('u_cost_center', row.u_cost_center);
gr.insert();
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2020 04:32 AM
Hi there,
Can you explain your requirement a bit more?
Is this about a MRVS on a Record Producer on the Service Portal? If yes: you could make use of the Script field on the Record Producer.
Question: what to do when you have 2 or more rows in the MRVS. Where should the values be mapped to? Map to field is 1on1.
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP
---
LinkedIn
Community article list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2020 04:37 AM
Hi Mark,
Thank you.
I have a record producer, in that have a MRVS which contains 15 variables. So I need to map the fields from MRVS to the respective table.
Regards,
Saridha.L

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2020 04:41 AM
So you don't mean something like map to field, though instead something like map to a new record? Like for each row a new record should be generated?
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP
---
LinkedIn
Community article list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2020 04:46 AM
For example , if we do map to field on any variable, the value will be updated in the table record. I have a same requirement in MRVS, after filling the fields, once I submit a record, value should be captured in the table field too.
Regards,
Saridha.L