Set value of a field, from a field in a MRVS
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2024 11:47 AM
Hello everyone!!
I have this field on the Form (Payment reference). with this MRVS (Booking details):
I need to populate in the "payment reference" field, with the value of "total expense" from MRVS.
I´ve tried with a onSubmit client script applied to a Variable set, but is not working.
If you have some idea i´ll appreciate.
Thanks!
5 REPLIES 5

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2024 08:06 PM
You can try below script:
function onSubmit(){
var mrvs= g_form.getValue('mrvs_variable_name'); // name of your mrvs avriable
var mrvsParsed= JSON.parse(mrvs);
var paymentRef= 0;
for(var i=0; i<mrvsParsed.length; i++){
paymentRef= paymentRef+ parseFloat(mrvsParsed[i].total_expense); // name of your variable in mrvs
}
g_form.setValue('pyament_Refernece', paymentRef); // validate the name of your variable
}
Best Regards
Aman Kumar
Aman Kumar