Jon G Lind
ServiceNow Employee
ServiceNow Employee

The ServiceNow Service Catalog Multirow Variable Set (MRVS) is a handy way to enter multiple rows as part of a Service Catalog request.  In this example a professor at a college wishes to make a request to change the grades of several students in a class and can enter the header information and then enter a row for each student with different values.

 

Like this!

MRVS - 01 Large.jpeg

 

Reading the Rows from Flow Designer

Once you've created your catalog item and attached a new flow with a Catalog Item trigger you need to process each of those rows.  You do that with the Flow Designer action called "Get Catalog Variables".  This action allows you choose the main catalog item and select the variables which you wish to use in your flow.

 

As you can see the standard non-MRVS variable sets have their values surfaced directly (in this case "campus", "instructor" and "course") but the MRVS variable set called Grade Change Student Info is returned as a JSON array.

 

MRVS - 02 Large.jpeg

 

Steps to complete

1. Add the "Get Catalog Request Variables" step and choose Trigger > Requested Item for the Submitted Request and your main Catalog Item for the template. (See above).

2. Select all variables and move them to the right hand "Selected" panel.

3. Add a "Flow Logic > For Each" step to loop the variable set array and select the variable "Grade Change Student Info" from the previous step like this:

MRVS - 03 Large.jpeg

4. You may now use the outputs from the for each to perform an action on each, and combine the values with the header values.  You even have access to the variable values with the pill picker.  For demonstration purposes I am logging the values like this:

MRVS - 04 Large 2.jpeg

 

That's it.  Good luck!

Comments
Shakeel Shaik
Giga Sage
Giga Sage

Great !! Thanks for sharing 🙂

Prinssi
Mega Sage

Very helpful!

 

Since the "Get Catalog Variables" action is limited to Catalog items, is there a comparable method for accessing MRVS data for Record Producers?

 

EDIT: Even though the action does not explicitly call out Record Producers, it does still work with Record Producers, and they come up in the reference within the action.  I have used this action for HR Cases and custom record types successfully. 🙂

Priyanka_786
Tera Guru
Tera Guru

Thanks for sharing.

Calob Gabriel
Tera Contributor

@Prinssi - I am using the For Each action with a record producer with no issues.  

nandhini muthu
Tera Contributor

Hi,

I have mapped the MRVS variable to Description field. Once ticket is created, it is showing only sys id instead of username in the desc field. Please help me to rectify it.

Thanks,

Nandhini Muthu

ArnasD
Tera Contributor

It works great with  string or reference variables in MRVS. But What about scenario if I have variable type "choice" in MRVs and need to get DisplayValue, instead of Value?

SanjivMeher
Kilo Patron
Kilo Patron

Very helpful

James160
Mega Guru

Thanks for sharing.

I tried this and found an problem.

When i input 1 row in MRVS, and get the value from flow designer, I got 2 rows data...

And the unexpected row is what I input last time I request the catalog item...

 

I'm in Washington version. 

Venky Kshatriy2
Tera Contributor

Hi @Jon G Lind  @SanjivMeher 

 

For reference filed it's giving SYS_ID but I need name of the record Name(like username not user record SYS_ID

Is it possible ? if any one knows, could pls help me on this

 

Advance thanks 

Venky Kshatriy2
Tera Contributor

And same values I need to push to sub flow

Calob Gabriel
Tera Contributor

@Venky Kshatriy2 - a reference field always returns a SYD_ID as the value.  You would have to likely use a look up record for the table that field references and use the SYS_ID as a parameter to get that record and its relevant data, or see if that data is available in the step it is from where you can dot-walk via the daa available in flow designer. Hope this helps! 

ChitranshSYadav
Tera Contributor

Hey, I have tried but i am not able to add into Ask for Approval.

reza1921
Tera Contributor

What could be the reason on not being able to see the MLV variable set but can see the individual ones when trying to add them in the list under the get catalog variables?

Prinssi
Mega Sage

@reza1921 The MRVS is an object with any number of rows that each contain their own variables (i.e. an object containing objects). To access the variable(s) contained in each row, you need to iterate through the rows.

 

In the example above, variables like "student" and "old grade" are not available in the Get Catalog Variables action, which is why the For Each action was used to iterate through the rows in the MRVS.

sharvil Sheth1
Kilo Guru

 

@Jon G Lind How can we do it for choice variable?

Version history
Last update:
‎12-06-2022 09:33 AM
Updated by:
Contributors