Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

I am struggling in MRVS

Taaha M
Tera Contributor

I have a requirement where I have to check for date/time of fields on MRVS from the form in catalog.
I have in total four date fields, 2 date fields in form level, and two date fields on MRVS, now my requirement is to validate the date fields in MRVS is in between the dates entered on form.
I am struggling to access the MRVS values on FORM level

2 REPLIES 2

Brad Bowman
Mega Patron

In a client script that applies to the Catalog Item, not the MRVS, you can access the entire MRVS value using

g_form.getValue('mrvs_internal_name');

This will give you a JSON formatted string containing each variable name and value for each row.  You can loop through these values like this:

var mrvs = g_form.getValue('mrvs_internal_name');
var obj = JSON.parse(mrvs);
for (var i = 0; i < obj.length; i++) {
if (obj[i].v_date1 != g_form.getValue('v_date2')) {
 ....
}

Replacing your MRVS internal name, the name of the MRVS variable (v_date1 in this example) and the name of the Catalog Item variable (v_date2 in this example).

Hemanth M1
Giga Sage

Hi @Taaha M ,

 

Have you tried this : https://www.servicenow.com/community/service-management-forum/how-to-access-multi-row-variable-set-i... 

 

 

Accept and hit Helpful if it helps.

Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025