how to call mrvs variables into a flow designer script without drag and drop

shabbir5
Tera Guru

Hi All,

 

I need call MRVS variables into a flow designer 

 

I am calling using "fd_data._1__get_catalog_variables.mrvs variable name" 

 

I am getting log output as [object,object]

 

but i need value of variable data information , Anyone please help me on this issue

 

Thank you,

Shabbir Shaik

1 REPLY 1

Sumanth16
Kilo Patron

Hi @shabbir5 ,

 

In Flow Designer, you'd use the same concept of retrieving those catalog variables as normal.

Then, for the MVRS, you'll see that it's an ArrayObject. From there, within the flow, you'd add a For Each Item step to walk through that ArrayObject, you could assign this to flow variables if needed.

Or, if you're sending a notification from the flow, you should be able to use the ArrayObject and write a script yourself to iterate through it, here's an example of a script action you could also use:

var sysID = fd_data.trigger.request_item.sys_id;
var rec = new GlideRecord('sc_req_item');
rec.get(sysID);
var arr = [];
var mrvsVar = rec.variables.name_of_mvrs_variable;
var parser = JSON.parse(mrvsVar);
for(var i=0;i<parser.length;i++){
	arr.push(parser[i].variable_name_within_mvrs.toString());

 Please consider marking my reply as Helpful and/or Accept Solution, if applicable.

 

Thanks & Regards,
Sumanth Meda