web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id : vAF3i2cejKmNJDqrdEhDhp
Power Automate - Building Flows
Unanswered

Send email depends on a country list including 45 countries.

Like (0) ShareShare
ReportReport
Posted on 12 Apr 2024 14:51:05 by 15

Hello,

 

I have a question regarding Sending emails flows. 

I have a MS Form and one of the questions is Country. IF Country is included in a list (45 countries there) then the email needs to be send to: managers@XXX.com; amanda.Garcia@XXX.com; John.schulster@XXX.com and if country is not in that list, then to amanda.Garcia@XXX.com; John.schulster@XXX.com

 

Tried the "switch" option "send email" for every country but I get the error "to many cases"

 

Flow save failed with code 'AllowedSwitchCaseLimitExceeded' and message 'The template action 'Switch' at line '1' and column '1920' is not valid: the number of cases used '45' exceeds the maximum number allowed '25'.'.

 

romovaro_0-1712933359676.png

 

Any other option to get this result? 

 

thanks

I have the same question (0)
  • romovaro Profile Picture
    15 on 15 Apr 2024 at 12:16:35
    Re: Send email depends on a country list including 45 countries.

    Tied also this approach but same results...something is off

     

     

    romovaro_0-1713183364622.png

     

  • romovaro Profile Picture
    15 on 15 Apr 2024 at 11:37:45
    Re: Send email depends on a country list including 45 countries.

    Hi Scott

     

    sorry to bother you- Not very fluent in the Power automate yet.

     

    Tried again. When I save it seems ok but...

    romovaro_1-1713180234592.png

    Currently my flow looks like:

    romovaro_0-1713180703403.png

     

     

    where Compose:

    romovaro_1-1713180756539.png

     

    Where Compose1: Just the Function? No need to add anything else?

    or Do I need to specify the Output from prev Compose?

     

    romovaro_3-1713180808173.png

     

    How DO i link the Compose and Compose 1 to my form? To a "Get response Details"?

     

    romovaro_4-1713180973068.png

     

    and the Condition:

     

    romovaro_5-1713180999619.png

     

    thanks,

     

  • ScottShearer Profile Picture
    25,236 Most Valuable Professional on 12 Apr 2024 at 16:15:33
    Re: Send email depends on a country list including 45 countries.

    @romovaro 

    You could use a switch or a condition.

    If you use a condition, the condition would be If Compose 2 is equal to -1

    If yes - this means country not found

    If no, the means country is found.

    Th error is with you send an email action.  Can you post a screen shot?

     

     

     

     

     

  • romovaro Profile Picture
    15 on 12 Apr 2024 at 16:10:24
    Re: Send email depends on a country list including 45 countries.

    Hello Scott and thanks for your quick reply,

     

    I followed your steps. I assume that after the second "compose" I need to use the switch + Send email option?

     

    If Case = -1 send email to.... and Default email to....?

     

     

    romovaro_0-1712938048340.png

     

    When I select the "switch" option I need to provide a parameter "on".... should be Compose 1?

     

    I get the below error:

    The input parameter(s) of action 'Send_an_email_(V2)' contain an invalid reference to 'Get_response_details'. Correct to include a valid reference to 'Get_response_details' for the input parameter(s) of action 'Send_an_email_(V2)'.

     

     

    Thanks

     

    Rob

     

     

  • ScottShearer Profile Picture
    25,236 Most Valuable Professional on 12 Apr 2024 at 15:09:19
    Re: Send email depends on a country list including 45 countries.

    @romovaro 

    You could simple add a second switch action, but that would be a very bad idea.....

    I suggest rewriting your Flow and removing the switch action.

    There are a number of ways of approaching this - here is a simple way.

    Add a Compose action

    Populate the Compose action with a delimited list of all countries

    Use a lastIndexOf() action to see if the country is listed in the Compose action.

    If it isn't found, the expression will return -1

    If any number other than -1 is returned, the country is in the list

    See my example below.  I hard coded a country - you will reference Dynamic properties

    image.png

    Please let me know if you need more help.

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 986 Moderator

#2
stampcoin Profile Picture

stampcoin 699 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 577 Super User 2025 Season 2

Loading started