can we add values of count field of multi row variable set and add in a variable in record producer

veenal
Tera Contributor

Hi,

I have created a MRVS and in that have a field as count , i want to sum all the records added to that MRVS and display in another variable on a record producer :

we are able to sum up the value but not able to extract to another variable from multiple row variable set. It's only working for on submit if we are adding client script on submit but we want it to be on load .

Adding screenshot for reference :

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@veenal 

this is possible.

as soon as you add a new row it will update the outer variable

check these links

How to calculate the sum of the value in MRVS (multi row variable set) 

Populate field outside MRVS with a total sum of fields inside MRVS 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

4 REPLIES 4

Chaitanya ILCR
Mega Patron

Hi @veenal ,

create an onSubmit client script on the Record producer and parse the MVRS and add up all the values and populate the variable

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya

 

We dont want it to be on submit . With onsubmit we have written and its working

@veenal 

check these links, whenever a new row is added/removed you can manipulate outside variable using widget

Widget that reacts to onChange event of Variable 

MRVS detect when a row is removed or deleted 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Ankur Bawiskar
Tera Patron
Tera Patron

@veenal 

this is possible.

as soon as you add a new row it will update the outer variable

check these links

How to calculate the sum of the value in MRVS (multi row variable set) 

Populate field outside MRVS with a total sum of fields inside MRVS 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader