How can we script the TO field in flow designer so emails should go out depending on app selected.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2023 08:50 AM
Hello everyone,
In Flow Designer, how can I script the "TO" field so if specific applications are checked then the email should only go out to the approvers for that applications. For example, I have about 20 applications listed on the form to be selected, but if only Longview and PRO apps are selected on the form , then email should only go out to the approvers in a single email string. Is that possible?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2023 09:00 AM
This is difficult to say without knowing your exact context, however some pointers to start with:
- Are you sure you need to script this? Can you not do a "Look Up Record" actions for your respective applications to get the approvers (if they are not already available via data pills)?
- If you must/prefer script, than have a look at the document on inline scripts here. You'll want to get started from the fd_data object to access other actions, your trigger, etc. in order to get values from them. You will need to make sure that at the end of your script, you are returning the value that you wish to set for the "To:" field, so in your case, you will want to have a comma separated list of email addresses in string format to return.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2023 04:34 AM
Hi Laszlo,
No sorry I don’t have data pills setup for approves, they will be random Dlist addresses . Can you please show me the screenshot how would the lookup record for approval will look like?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2023 11:17 PM - edited 02-14-2023 11:18 PM
Hi,
I agree with Laszlo, if you can avoid scripting, and instead use datapills, that would be preferred.
If you still must rely on scripting, here's a simple example on how it could look like.