How to script name value pair in Flow Designer?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2023 01:58 PM
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:
To use the Email variables to submit the catalog item, you have to use the name/value function:
But, I can't access the value in the email variable using a function in the Look Up Record action:
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?
Here's the flow:

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2023 02:24 PM
Hi,
I suggest you write a custom action which takes the input as user_id and return the sys_id back to the flow. You are anyway getting the user_id from your earlier action, pass that to your custom action, in that add a script step, do a gliderecord and return the sys_id as output variable.
Mark the comment as a correct answer and also helpful if this helps to solve the problem.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2023 11:11 PM
It would be:
fd_data._1__parse_email_body_test.email_variables['<name of the variable>']
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2023 11:14 PM
But I strongly recommend replacing inline scripts that refer to data pills with (custom) Actions: sooner or later you will have to insert an action or logic or sub-flow and suddenly your inline scripts no longer work as they refer to non-existing data pills. You do not run that risk when using Actions.