Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

Send email depends on a country list including 45 countries.

(0) ShareShare
ReportReport
Posted on 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

  • romovaro Profile Picture
    15 on at
    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 at
    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 at
    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 at
    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 at
    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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1