I know this has been suggested as an idea, but I don't see a workaround for this. (Which is extra frustrating because I have to do it this way because I'm using a workaround for checking multiple value checkboxes, but here we are)
What I'm doing is working with calendars. Say Calendar 1, A, B, and C. I have a column on Calendar 1 called "Applies To" and the choices are A, B, and C. These are checkboxes. So when the users add something to Calendar 1, and choose A, B, or C, the workflow adds the items to whichever calendars are selected. So if someone adds an item, and chooses B, the workflow needs to add the item to Calendar B as well.
Since Flow apparently can't handle looping through checkbox selections and run conditions based on the selections, my workaround is to loop through the selections and add them all to a string variable. Then I check if the variable contains B (for example), and if it does, I create the new item on B.
It would be very nice to not have to do a bunch of regular If statements and could just do a switch case, but it only gives me the option to check 'equals' on the case. I need it to do 'contains'.
I laid out this whole situation in case there's a better way to handle this that I'm missing, because I'm sure that I'm not the first person to try to do something like this.
Want to add that the string comes back like this:
I'm going to try to do some sort of substring method, but I still wish there was a simpler answer to something that really should be very basic, so I'll leave this up for thoughts.
Could you please show a bit more about the Calendar 1, A, B and C that you mentioned?
Do you want to use contains operator within Switch case action in Microsoft Flow?
I afraid that there is mo way to use contains operator within Switch case action in Microsoft Flow currently, the Switch case action only support equals operator. If you would like this feature to be added in Microsoft Flow, please submit an idea to Flow Ideas Forum:
More details about the usage of Switch case action, please check the following article:
In addition, you could consider take a try to add nested Conditions within your flow instead of Switch case to achieve your needs. Within Condition box, you could use Contains operator. More details about the usage of nested Conditions, please check the following article:
I needed to send email to users only once and not repeat their email address.
This is what I have done:
I had a similar probIem and I worked around it by:
Converting the string to an array (use split). In your case I think it would be the string that loops through the selections and adds them all to a string variable.
You can then Set up an Apply to each and inside it set up your Case switch
We've updated and improved the layout and uploading format of the Power Automate Cookbook!
Fill out a quick form to claim your user group badge now!
We've given our badges an overhaul and also added some brand new ones!
Learn how to build the business apps that you need.
Find out where you can attend!
Watch & learn from the Power Automate Community Video Gallery!