how to add rows automatically in MRVS based on mrvs variable

shabbir5
Tera Guru

Hi All,

We have a MRVS , inside that we are having 3 variales

variable 1: Days : select box : Weekdays , Weekends , All , Monday , Tuesday , Wednesday , Thursday , Friday , Saturday , Sunday

Variable 2 : Start Time : single line text

variable 3 : stop time : single line text

Requirement : when i select , Days as "Weekdays , and Start time as : 11 and stop time as : 12 and when i click "add"

then automatically 5 rows should add to the MRVS as below

monday     11     12

tuesday     11      12

wednesday  11     12

thrursday     11      12

friday            11     12

similarly when i select All , then all days should add , when i select weekends , saturday and sunday should add

is that possible?

please provide your inputs @Ankur Bawiskar 

Thank you,

Shabbir

 

4 REPLIES 4

Community Alums
Not applicable

Hi Shabbir,

This Article explains all which should help you :

How to add rows dynamically in Multi Row Variable set (MRVS) based on input value of Catalog item

Mark my answer correct & Helpful, if Applicable.

Thanks,

Sandeep

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

you can observe the Add/Remove button of MRVS and based on that set the MRVS value

https://community.servicenow.com/community?id=community_question&sys_id=10374cbbdbc19110904fa9fb1396...

Regards
Ankur

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

@shabbir 

Hope you are doing good.

Did my reply answer your question?

If my response helped please close the thread by marking appropriate response as correct so that it benefits future readers.

Regards
Ankur

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

Alexandre Magea
Kilo Expert

Hi Shabbir,

MVRS's content can be extracted or filled-out as JSON text.

What I could recommend it the following:

-Create a script to alert the content of your MVRS. Fill the MVRS with the desired values, and execute the script to show the generated JSON. Save it somewhere.

-Do the same with the different scenario and save each JSON being generated.

-In your code, define the MVRS's values using the JSON you obtained based on the conditions you mentioned.

 

I hope it helps!

Alex