I want to auto populate the number in multirow variable set for each row
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2022 05:04 AM
Hi Team ,
I have a requirement to auto populate the number field in multirow variable set in ascending order .
In the multirow variable set we have a field called "Number of Chefs" each time when we add one row that time the number of chef should auto populate starting from 1 .
Note: Field type is string Thanks in Advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2022 05:34 AM - edited 10-14-2022 05:44 AM
If MRVS is being used in Record Producer, then try utilizing below record producer script.
var mrvs = JSON.parse(producer.<mrvs_backend_name>);
for(var i=0; i<mrvs.length; i++){
mrvs[i].<backend_name_of_number_column> = i+1;
)
If MRVS is being used in Catalog Item (Not Record Producer), then try with below onSubmit() Catalog Client Script.
function onSubmit(){
var mrvsValueStr = g_form.getValue('<backend_name_of_mrvs_variable>');
var mrvs = JSON.parse(mrvsValueStr);
for(var i=0; i<mrvs.length; i++){
mrvs[i].<backend_name_of_role_owner_variable> = i+1;
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2022 10:42 PM
The above record producer script is not working , that is not getting into the MRVS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2022 12:44 AM
What did you try?
Can you share your script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2022 09:14 PM
please find the above script which i have tried in record producer script