How to script name value pair in Flow Designer?

gjz
Mega Sage

I need some help getting a value from a name/value pair variable in a Look Up Record action in Flow Designer.

 

My flow is triggered from an inbound email, which is used to submit a catalog item.

 

Since you can't parse the body of an email in flows I used Ben Scherer's "Parse Email Flow Action" action, which works great.  However, it parses the UserID field in the body of the email as a string and on the catalog item the corresponding field is Requested for, which is a reference field and the Submit Catalog Item Request action won't allow me to use the UserID variable in the Requested for field.

 

I though I could solve the problem by doing a Look Up Record action before submitting the catalog item to get the user sys_id, but I'm not sure how to script it.  Can anyone help me with that?

 

Here's what I have available to use for the script:

gjz_0-1683233364310.png

To use the Email variables to submit the catalog item, you have to use the name/value function:

gjz_1-1683233475769.png

 

But, I can't access the value in the email variable using a function in the Look Up Record action:

gjz_2-1683233568601.png

So I thought I would script it instead - and that's where I'm stuck.  This is as far as I get.  How can I get the value so that I can return the sys_id to set the Requested for in the Submit Catalog Item Request action?

gjz_3-1683233647121.png

Here's the flow:

gjz_4-1683233855271.png

 

5 REPLIES 5

AyanshN
Tera Contributor

you can use by this
var attachment = {};
var name=fd_data.trigger.current.file_name;
var value=fd_data.flow_var.url;
attachment[name] = value;
return attachment;