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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Send email depends on ...
Power Automate
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

Categories:
  • ScottShearer Profile Picture
    25,331 Most Valuable Professional on at

    @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.

     

     

  • romovaro Profile Picture
    15 on at

    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,331 Most Valuable Professional on at

    @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

    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,

     

  • romovaro Profile Picture
    15 on at

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

     

     

    romovaro_0-1713183364622.png

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 289

#2
11manish Profile Picture

11manish 282 Super User 2026 Season 2

#3
Henil Profile Picture

Henil 119

Last 30 days Overall leaderboard