- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-11-2022 01:49 PM
Hello developers,
I know this question has been asked several times and I researched each different way but I haven't had any luck.
The backstory is that I'm building out a catalog item and once its submitted it goes through a workflow using flow designer. However, once I get the catalog variables, I want to send an email to certain individuals once the request is created, which I have that part working. The problem is that I'm trying to get all of the catalog variables in that email. I know I can just drag and drop the data pills but instead of giving me the display values, I'm getting the sys ids. So I tried using a script to pull in the catalog variables, which technically works but it only gives me the first variable and not all of them. Is there a way to get the display value of all the catalog items dropped into the email using flow designer?
Here's a copy of my script:
Here's the context of what I'm using it for:
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-11-2022 02:43 PM
Hi,
The problem with your script is that you use "return" to early, it stops the script and returns, so the rest of the script is not evaluated.
You can change your script into something like this:
var mailtext = '';
var submitter = fd_data.trigger.request_item.variables.submitter.getDisplayValue();
mailtext += 'Requested by: ' + submitter;
var emailt = fd_data.trigger.request_item.variables.email_address.getDisplayValue();
mailtext += 'Email address: ' + emailt;
//... and continue on with all the other variables
return mailtext;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-11-2022 02:09 PM
If your catalog variable is a Reference field, you should be able to get various values from the record including the display values in the right hand pane.
Here's what I see for my assignee catalog variable which references the sys_user table. Note the little arrow to the left means I can expand it and get to the Name field of the sys_user record
So in the email, I can use the Name field:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-11-2022 03:01 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-14-2022 07:13 AM
You need to expand the Reference data pill to dot walk to the values you want to put into the email that are not the sys_id. If you expanded a User reference field, you should be able to scroll down to get the Name of the user to put into your email body.
The benefit of this method is that you can compose the email in the body with the wysiwyg rich text editor and would not require scripting. It is, presumably, easier to maintain for low-code/no-code citizen developers should any need to update the Flow in the future.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-16-2022 07:59 AM
Hi Nia,
Using the data pills was easier than coding and it worked on most of my variables. However, I had some variables that are populated from a list collector and I didn't have a way to expand on them to get their name. When I tested out the flow, it would still give me the sys_ids instead of the names of those values, but using your method, I was able to get the display values of the other referenced fields.
Thanks again for your help!
Best regards,
cnharris