Interested in a ServiceNow event built for developers? Registration for now[dev]26 is officially open!

How to populate a multi row variable set based on selected variables in a catalogue item

matthew_hughes
Kilo Sage

I'm the below catalogue item where users have to select their options:

matthew_hughes_0-1734002543946.png

 

On the final part of my catalogue item, I have a multi row variable set where I'm wanting to add the selected details:

matthew_hughes_1-1734002620870.png

 

Does anyone know how I need to populate my multi row variable set with the selected options?

 

1 ACCEPTED SOLUTION

matthew_hughes
Kilo Sage

I removed an if statement from my script include which was causing an issue.

View solution in original post

19 REPLIES 19

@matthew_hughes 

that would be ideal.

Some sort of variable -> Add Details (Yes/No)

Have a onChange script on that variable and if Yes then get values from top 4 variables and use GlideAjax to query the business app table and bring in the values and set the MRVS using this

g_form.setValue('mrvsVariableName', yourJsonString)

If they select No then clear the MRVS

g_form.clearValue('mrvsVariableName')

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

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

Hi @Ankur Bawiskar I've just had an update on the requirements on when the multi row variable set would need to be populated:

 

If a user just selects a platform then it should just show that platform but if they select a lab it needs to show the lab

@matthew_hughes 

you can determine what value is selected in Q3 or Q4 and based on that auto populate

I hope this much info should help you to start

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

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

Hi @Ankur Bawiskar How would I do that?

@matthew_hughes 

Please start the script from your side as we don't have all the details with us to get started

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