cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
forestinfo
Regular Visitor

Dynamic email recipient list

Hi,

I am trying to use automate to build a email recipient list based on a series of questions that have been answered earlier.
There are three different questions to ask about who to send to - auditor, regional manager & external contractor (with a field to fill provide an email address for the last one). Each are stand alone questions (so it could got to external contractor not the auditor etc) meaning that by the time there are 5 regions we have 35 different options of email recipient lists.

What I am wondering is there a way to do this without building a really wide flow with 35 different parts to it? What I am imagining is starting with beginning a list at the start and if they say to send to auditor, it adds person x, if they say regional manager it adds the person for that region previously selected etc.

Is this possible? Or are a whole heap of controls the best option?

4 REPLIES 4
BenjaminJarry
Helper III
Helper III

as far as I tested, there is no "non-coded" solution to add forms choice lists items dynamically

 

better solution is to use forms branch behaviour

 

when selecting answer A from Q1 -> Q2

when selecting answer B from Q1 -> Q3

when selecting answer C from Q1 -> Q4

 

v-litu-msft
Community Support
Community Support

Hi @forestinfo,

 

Where are these email recipient stores? And what's the structure of the list?

If possible, could you give us an instance? (please shield personal information)

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi,

 

Currently the emails are from three different areas.

 

Question 1 - Do you require an email notification to be sent to yourself? If yes - sources email from auditor user ID built into the survey as a earlier initialized variable

Question 2 - Do you require email to be sent to the the regional Roading Manager? We have 5 possible regional roading managers. Region is already provided in the survey based on the details provided earlier. Hoping to get these into a list (when there is only 5 it makes it a bit easier) so that if Northland is selected, email goes to a.adams@organisation.com, if its Bay of Plenty, then b.brady@organisation.com etc

Question 3 - do you require email to be sent an external contractor? If so Please provide email in the following question. This then has the email to send to. 

 

Currently I have set it up as follows -

Condition - do you want to send am email to yourself? 

 > If yes then uses user email variable and sends one email

Condition - do you want to send email to contractor?

> If yes then uses provided email to send email to contractor

Condition - do you want to send email to regional roading manager?

>If yes then switch for region with 5 different options

 

And while this works it doesn't feel that clean and is sending three separate emails rather than all as one which is the ideal. 

solution could be to initialize an empty variable "MailRecipient" that you populate after each condition

IF Q1 = YES then 

    Add to text variable "xxx1@xxx.com,"

IF Q2 = YES then 

    Add to text variable "xxx2@xxx.com,"

IF Q3=YES then 

    Add to text variable "xxx3@xxx.com"

 

Then you end up with a text variable that may contains xxx1@xxx.com, xxx2@xxx.com, xxx3@xxx.com if you answered yes

 

Then you can use this variable as mail recipient in the only mail steps in your workflow

 

N.B. : When I see you first questions, it makes me believe this xxx1@xxx.com should not be in Recipient (TO) but as copy (CC)

Helpful resources

Announcements
MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MSFTBizAppsLaunchEvent

Experience what’s next for Power Virtual Agents

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Users online (18,392)