Flow Designer - Script to look up or concatenate value from a referenced list field

AEterni
Mega Guru

Hello Team,

### INTRODUCTION ###

  • We have a custom table called "u_distribution_lists"
  • In this custom table, we have a field called "Users to inform"
  • The type of the field is "List" and is referenced to "sys_user" table
  • The field can contain one or multiple values
  • We use this custom table in some catalogue items

### DESCRIPTION ###

We have designed a very simple flow that interacts with the catalogue items mentioned above, but we are stuck because we can't get what we want out of this flow. The two things we can't figure it out are:

Action Send Email

  • Populate the field "CC" with all values in the field "Users to inform"
  • List the value of the field "Users to inform" in the body of the email

### FLOW DETAILS ###

In our first iteration of the flow, the action "Send Email" looks liks this.

find_real_file.png

We faced two problems:

  • Field "CC": Although the "dot-walked" fiels called 1-->distribution_list-->Users to inform contains all the values of the referenced list (tested wiht a "Log" action, we can see both values), the field "CC" picks up only the first value of the list
  • Field "Body": The "dot-walked" fiels called 1-->distribution_list-->Users shows both values, but the SysID and not the email address

In our second iteration of the flow, we tried to work around the SysID issue using two actions:

  • Look up the "[sys_user] Records
  • For Each Item on the Look up Recors action

By doing this we can get the email address, but we can use it only within the "For Each" loop, namely we can send out the email properly to each user, but not in bulk to all users.

### QUESTIONS ###
Although with the second iteration we can get the email address, I don't think this is the right approach. We think we should stick with the first iteration of the flow, but script something in both the "CC" and "Body" field rather than "dot-walk" the 1-->distribution_list-->Users to inform.

We don't have script knowledge. Do you have any suggestion?

Thank you.

Best regards.

2 REPLIES 2

Maik Skoddow
Tera Patron
Tera Patron

Hi @Alessandro Eterni ,

to my mind, there is also another approach.

First I would always prevent using the send email action from a flow because each time you have a configuration change you to have to update and republish the flow.

Better use the common notifications with "Send when" = "Triggered" and at your flow the "Send Notification" action with "Table" = u_distributions_lists.

At your notification, you still need a Mail Script to populate the CC field and the mail body.

Kind regards
Maik

If my answer replied your question please mark appropriate response as correct so that the question will appear as resolved for other users who may have a similar question in the future.

Thank you for your feedback.

We don't want to script unless it is strictly necessary.

We talked with our users and found an alternative solution that we can deploy using Flow Designer and its standard Actions.