Need Help with mrvs in flow designer

tyagi_amrit2701
Tera Contributor

Hi all,

I can't use look up record in multi row variable set while using for each in flow designer .the field I am trying to access in multi row variable set is lookup select box,  is there any way through which I can use look up record in multi row variable set.

 

32 REPLIES 32

Shivalika
Mega Sage

Hello @tyagi_amrit2701 

 

In Flow Designer, when using a For Each loop on a Multi-Row Variable Set (MRVS), you may face issues accessing Lookup Select Box values. This happens because Lookup Select Box fields store reference values as display names, not sys_ids, which causes problems when trying to fetch records using the "Look Up Record" action.

 

 

The way to go around this would be to retrieve the sys_id of the lookup value and then add Look Up record. Now to retrieve the sys_id you need to add a script action - custom action.

 

(function execute(inputs, outputs) {

    var lookupValue = inputs.lookup_select_box; // This holds the display value

    var gr = new GlideRecord('your_lookup_table'); // Change to the correct table name

    gr.addQuery('name', lookupValue); // Adjust this field based on your lookup table

    gr.query();

    if (gr.next()) {

        outputs.sys_id = gr.sys_id.toString();

    } else {

        outputs.sys_id = "";

    }

})();

 

Use the sys_id from the script output in the Look Up Record action.

 

Kindly mark my answer as helpful and accept solution if it helped you in anyway,

 

Regards,

Shivalika 

 

My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194

 

My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeEISQCY

Medi C
Giga Sage

Hi @tyagi_amrit2701,

 

Unfortunately, you cannot use look up record in multi row variable set. What you can do, is to get your MRVS. It will be an array of JSON. You can parse it and apply your logic.

 

You can create an action in Flow Designer, which can be given the MRVS as an input, then parse it to JSON and return the outputs you need. 


If you found this helpful, please hit the thumbs-up button and mark as correct. That helps others find their solutions.

Murthy Ch
Giga Sage

@tyagi_amrit2701 

I believe you can access the MRVS lookup select box in flow using for each.

See below how I accessed it:

MurthyCh_0-1742358481094.png

MurthyCh_1-1742358503293.png

MurthyCh_2-1742358522693.png

 

What is the issue you are facing? Share the flow if you can.

Happy to help

Thanks,
Murthy

Hi @Murthy Ch 

Please find the screenshot of the error @Ankur Bawiskar  I've done it similarly as you've mentioned but it's not working please find the error screenshot instead of sys id i've used display name as well but no luckflow error.PNGflow error 2.PNG