mvrs : Need to count number of rows

Patrick Boutet
Mega Expert

I have a catalog item with a multiple row variable set. 

I would like to display (in another field of the form), information related to mvrs data
For example, number of rows.

I tried with onSubmit catalog script on mvrs but found that this kind of script can't access variables outside mvrs.

Do you have any idea ?

11 REPLIES 11

Mark Roethof
Tera Patron
Tera Patron

Hi there,

Did this solve your question? Or do we need to follow-up on this?

Please mark this answer as correct if it solves your question. This will help others who are looking for a similar solution. Also marking this answer as correct takes the post of the unsolved list.
Thanks.

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

LinkedIn

Willem
Giga Sage
Giga Sage
//get the MRVS
    var multiRowVariableSet = JSON.parse(g_form.getValue('variable_set_1'));
var numberOfRows = multiRowVariableSet.length;

 Please also see the article I wrote explaining MRVS:

https://community.servicenow.com/community?id=community_article&sys_id=f911162e1b6e1054d2ccea89bd4bc...