Help with capturing data pills from a Multi-Select variable in Catalog Item, using Flow Designer

JR42
Giga Guru

Hello, I am attempting to create a flow that will take input from the Catalog Item and update two fields on the Company records (core_company).  It works great for a single Company, using the Choice > Record Reference variable type. 

Using a 'Get Catalog Variables' action, it pulls in the selected company and all of it's associated fields, and allows me to use the data pill to lookup and update that company record.

 

I would like the user to be able to select multiple customers, since there are times that they will all need the same value applied to the fields.  When I use a Multi-Select variable type (Choice > Multi-Select), the data pill captured in the 'Get Catalog Variables' action is listed as a 'list' and has no drop down.  Ideally, it would have each of the selected companies listed, and, I would be able to use it in a 'For Each item in' Flow logic to lookup and update each of the selected Companies.

 

Does anyone know how to accomplish this?

 

Flow Steps:

Trigger: Service Catalog

Actions:

1) Get Catalog Variables

2) Look Up Company Records from the Company variable in the catalog variables

3) Update Company Records identified in the Look Up action.

2023-02-21 08_52_59-Flow Designer - Flow Designer _ CXM Meeting Cadence.png

 

This is what I get when using a Multi-Select variable type:

2023-02-21 08_22_58-Flow Designer - Flow Designer _ CXM Meeting Cadence.png

 

And this is what I get when I only let the user select one record in the request, and, what I would like to see from the multi-select variable:

2023-02-21 08_27_49-Flow Designer - Flow Designer _ CXM Meeting Cadence.png

 

Thanks!

2 REPLIES 2

raphaelcrv
Kilo Guru

Hey
Justin

Maybe you can create a action and use a script to get the multi select variable, for example:.

var gr = new GlideRecord('sc_item_option_mtom');
gr.addQuery('request_item', current.sys_id); // filter by the current request item
gr.addQuery('sc_item_option.name', 'my_multi_select_variable'); // filter by the name of the Multi-Select variable
gr.query();
if (gr.next()) {
    var multiSelectValues = gr.sc_item_option.value.split(',');
}

 
and after you get the options use a for each to update the record:

multiSelectValues.forEach(function(value) {
    // Do something with the Multi-Select value
});
If my response was helpful and/or provided a solution, please consider marking it as such. Thank you!