Power Automate Exchange

Please login or click SIGN UP FOR FREE to create your FlowUG account to join this user group.
Expand all | Collapse all

Sending an Email to a user depending on choice selected from a dropdown box

  • 1.  Sending an Email to a user depending on choice selected from a dropdown box

    Gold Contributor
    Posted Apr 26, 2021 06:29 AM

    Hi,

    I've seen some blogs that resolve this issue, partially.  If you only have two options.   Currently we do and I've created the Flow to send the required Email to the correct account.



    We will be expanding the options in the coming weeks, so what is the best solution to use when there are more than two options?

    Would the use of the 'And' or 'Or' functions be used from the Condition?  If so how?



    ------------------------------
    Chris Clark
    Test Analyst
    ------------------------------


  • 2.  RE: Sending an Email to a user depending on choice selected from a dropdown box

    Top Contributor
    Posted Apr 27, 2021 04:28 AM
    If the operand will always be "is equals to", then use a switch.

    ------------------------------
    Will Page
    Technical consultant
    Christchurch, NZ
    ------------------------------



  • 3.  RE: Sending an Email to a user depending on choice selected from a dropdown box

    Posted Apr 27, 2021 04:38 AM

    I have a couple of suggestions.  If the choices are limited to say 6 or less and do not change frequently,  You can use a switch / case statement to make the choice and either set a variable for the email and then do one email send or put the email send in each branch.  In the one shown below, we set the variable but then also start a ticket one branch of the statement. 


    The alternative where you have more choices for the email is to maintain a separate list where you lookup (Get Items from Sharepoint with a oData filter) the choice and grab an email and any other information from a list. My example is choice of school where we lookup the school name and get the counselor and counselor email to send an approval.  Hope this helps!



    ------------------------------
    Rod Middleton
    Director of Information Technology Services
    Sidney MI
    9893281202
    ------------------------------



  • 4.  RE: Sending an Email to a user depending on choice selected from a dropdown box

    Gold Contributor
    Posted Apr 27, 2021 05:50 AM

    Hi

    Thank you both @Will Page & @Rod Middleton for your replies.

    Hope you don't mind but I have a few additional questions?

    I would assume when there are more than two options the 'is Equal to' function becomes redundant?​  Sorry I'm new to Flow.

    The tracker is currently used by two of our applications but it could be expanded to all our application which exceeds 10.  Some of the applications are looked after by the same team.  I'm trying to get all the Department to create a 'Department' Mailbox so I can use this and it will help when people join, leave or move from the team. Suppose best is to group the applications into the teams that look after them??

    The create ticket action.  Can you expand on this please??  Would this be able send a ticket to our main ticket / task system (Remedy)?

    The Email action.  How is that executed?




    ------------------------------
    Chris Clark
    Test Analyst
    ------------------------------



  • 5.  RE: Sending an Email to a user depending on choice selected from a dropdown box

    Posted Apr 27, 2021 07:36 AM
    Within the same Switch statement, each is Equal should be paired with unique values.  You could exceed 10 if it is acceptable to maintain the multiple case statements in a  flow.

    Sorry, the create ticket example was to show that multiple items could happen in that branch of the statement.  For us, we are using the Plumsail service desk system and use their action to create a ticket if the inquiry option selected was IT.

    ------------------------------
    Rod Middleton

    ------------------------------



  • 6.  RE: Sending an Email to a user depending on choice selected from a dropdown box

    Gold Contributor
    Posted Apr 27, 2021 08:35 AM

    Hi Rod,

    Just to clarify the 'Sending Mail' step you have shown needs to be repeated under each 'Case', Add an Action?



    ------------------------------
    Chris Clark
    Test Analyst
    ------------------------------



  • 7.  RE: Sending an Email to a user depending on choice selected from a dropdown box

    Posted Apr 27, 2021 08:40 AM
    No.  We set the variable with the email address in the case branch and then have one send email action that has all of our information from the request form.  You could send emails in the branches as well.

    ------------------------------
    Rod Middleton
    ------------------------------



  • 8.  RE: Sending an Email to a user depending on choice selected from a dropdown box

    Posted Apr 27, 2021 12:48 PM
    Hi Chris,
    I've had success using the "Switch" Control rather than the Condition Control block. The Switch keys on the field with the drop down menus and then the resulting branches are dependent on the choices. It reminds me of those old "piggy" banks where you drop the coin in and it rolls along the track until it gets to the slot that matches its size.
    Hope this helps.
    Good luck.

    ------------------------------
    Brian Evans
    ------------------------------



  • 9.  RE: Sending an Email to a user depending on choice selected from a dropdown box

    Silver Contributor
    Posted Apr 28, 2021 01:11 PM
    Switch case is gonna be your best friend here. No worries about and/or conditions - save the email to clipboard and delete the step. Switch lets you just keep adding more options as you need them.

    My FAVORITE part is that it even gives you an option for "everything else not otherwise specified" so that if (when!) someone updates your field without telling you to update the workflow, those options don't end up in some cyber abyss.

    ------------------------------
    Rachel Davis
    Program Manager, Business Operations
    Rockwell Automation
    ------------------------------



  • 10.  RE: Sending an Email to a user depending on choice selected from a dropdown box

    Gold Contributor
    Posted Apr 29, 2021 09:13 AM
    Hi,

    Thank you @Rod Middleton, @Brian Evans and @Rachel Davis for your suggestions.

    As always there are many ways to perform an action.  Switch does seem to be the easier and more flexible of the option provided ​​​​

    ------------------------------
    Chris Clark
    Test Analyst
    ------------------------------