The CreatorCon Call for Content is officially open! Get started here.

Support Required: Record Producer Not Updating Description with MRVS Values

kanvapuriga
Tera Contributor

Hi All,
I have created a Record Producer that includes a Multi-Row Variable Set (MRVS). My objective is to automatically append the values from the MRVS to the record's description field upon submission of a request.
I attempted to achieve this using an "After Insert" Business Rule; and also from Reocrd producer script section-however, the variables within the MRVS are not being appended as expected.
Could anyone please guide me on how to implement this functionality effectively?
Thank you in advance for your support.

3 REPLIES 3

sizzleMcFace
Giga Guru

This happens because MRVS data isn’t directly accessible through producer.variable_name in the Record Producer script, it’s stored as JSON. 

 

You don't need a Business Rule for this, running your script in the Record Producer ensures the description is updated before the record is finalized. 

 

For detailes, see : Scripting the Multi-row Variable Set from Brad Tilton

G Ponsekar
Giga Guru

Hi @kanvapuriga ,

 

Try with below script in record producer

// Get the MRVS data as a JSON string
var mrvs_json = producer.mrvs_variable_set_name;

// Parse the JSON string into a JavaScript array of objects
var mrvs_array = JSON.parse(mrvs_json);

// Initialize a string to hold the formatted MRVS data
var mrvs_description = "\n\n--- Details from MRVS ---\n";

// Loop through each row of the MRVS
for (var i = 0; i < mrvs_array.length; i++) {
    var row = mrvs_array[i];
    
    // Add each variable's value to the description string
    // Access the variable by its internal name    mrvs_description += "Variable Name: " + row.variable_name + "\n";
}

// Append the formatted string to the current record's descriptioncurrent.description += mrvs_description;

 

To find the internal names for your MRVS and its variables:
  1. Navigate to your record producer.
  2. Go to the Variable Sets related list to find your MRVS.
  3. Right-click the variable set's header and select Configure > Form Layout. Add the Internal Name field to the form if it's not already there.
  4. Open the variable set record to view its internal name.
  5. In the variable set record, go to the Variables related list to find and copy the internal names for the individual variables you want to append.

 

 

If I could help you with your Query then, please hit the Thumb Icon and mark as Correct !!

 

Thanks, GP

 

Ankur Bawiskar
Tera Patron
Tera Patron

@kanvapuriga 

seems a duplicate question.

I already responded to your other thread below, please delete this one

Issue with Appending MRVS variables to Record Description 

 

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