Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to calculate fields from Multi Row Variable Set and update external variables in real-time?

SREEKANTH_P
Tera Contributor

I’m working on a catalog item where I’ve defined a Multi Row Variable Set (MVRS) named invoice_details. This MVRS contains the following variables:

original_amount

revised_amount

invoice_date

I have the following requirements:

I want to add a read-only calculated variable inside the MVRS called cost, which should be the product of original_amount and revised_amount.

This cost field should update in real-time as the user updates the original or revised amount.

Outside of the MVRS, I have two calculated fields:

revenue_impact_dc → should be the sum of (original_amount - revised_amount) across all MVRS rows.

revenue_impact_usd → should be the above result multiplied by a budget rate, which comes from a separate single variable or table.
How can I achieve:

The real-time update of the cost field inside MVRS

And the recalculation of the external revenue impact fields whenever the user changes the MVRS values?

SREEKANTH_P_0-1750312075737.png

 

5 REPLIES 5

@Roshnee Dash 

Thanks for sharing.

but can you share the usage of below method as I couldn't find it anywhere

g_form.getMultiRowVariableCount

 

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