cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
kramerica
Level: Power Up

If one or more (any) item in choice field is selected

I have a form that has several multiple choice fields. Each choice field should direct an approval to a different person - such that if someone selected "option 1, 2, and 3, but not 4 or 5" from a field called "IT Access Permissions" the approval will be sent to the IT manager. Similarly with a choice field called "Finance Access Permissions" and so on. 

I want to create a condition of "if anything within this multiple-choice field is checked then perform action". How might i go about doing this? 

One condition is that my company wont let me use powerapps, this has to be completely within flow. 

Thank you.

 

Edit - Solved...

Older forum posts were using a different function formatting, so none of them worked for me. I set a condition using "empty(triggerBody()?['fieldName'])" is equal to "TRUE" and that seemed to work. Not sure why it has to be "triggerBody"...  but I'm new to this so, yeah. I found that "peeking at code" from a previous flow item revealed the parts of the formula i was looking for. 

Hope this helps someone else.

1 ACCEPTED SOLUTION

Accepted Solutions
kramerica
Level: Power Up

Re: If one or more (any) item in choice field is selected

Edit - Solved...

Older forum posts were using a different function formatting, so none of them worked for me. I set a condition using "empty(triggerBody()?['fieldName'])" is equal to "TRUE" and that seemed to work. Not sure why it has to be "triggerBody"...  but I'm new to this so, yeah. I found that "peeking at code" from a previous flow item revealed the parts of the formula i was looking for. 

Hope this helps someone else.

View solution in original post

3 REPLIES 3
Dual Super User
Dual Super User

Re: If one or more (any) item in choice field is selected

Hi @kramerica 

 

For checking across multiple selected operations, you could use the condition control and group the possible choices against the approval action. 

 

Another way is to initialise and create multiple arrays that would have the options for a particular approver and then get the choices selected in a new array. Add a condition action to check if the parent array contains the elements of the array created by populating teh choices from the SP list item (makes sense?) and then add the consecutive actions accordingly. 

 

If it would be single choice type, the best way to do this would be using the switch case control. 

 

Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Community Support Team
Community Support Team

Re: If one or more (any) item in choice field is selected

Hi @kramerica ,

 

Do you want to send out an approval email based on different choices?

 

Are you working with Microsoft Forms? Could you share more details on the form’s configuration?

 

Let’s say that you have multiple selections enabled field in the form, and you want to send an email to different people for approval based on the selections. If the selection is Test2 and Test3, send an email to user1, if the selection is Test4 and Test5, send an email to User2, otherwise send an email to User3.

 

I have set up the flow likes below for your reference, the function used in the To field is:

if(and(contains(body('Get_response_details')?['r57b450d4a73547e88415d168e951b14a'],'Test2'),contains(body('Get_response_details')?['r57b450d4a73547e88415d168e951b14a'],'Test3')),'test4@xxxxx.onmicrosoft.com',if(and(contains(body('Get_response_details')?['r57b450d4a73547e88415d168e951b14a'],'Test4'),contains(body('Get_response_details')?['r57b450d4a73547e88415d168e951b14a'],'Test5')),'mabel@xxxxx.onmicrosoft.com','test2@xxxxx.onmicrosoft.com'))

1.PNG

 

Hope it could be a reference for you.

 

Best regards,

Mabel          

 

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
kramerica
Level: Power Up

Re: If one or more (any) item in choice field is selected

Edit - Solved...

Older forum posts were using a different function formatting, so none of them worked for me. I set a condition using "empty(triggerBody()?['fieldName'])" is equal to "TRUE" and that seemed to work. Not sure why it has to be "triggerBody"...  but I'm new to this so, yeah. I found that "peeking at code" from a previous flow item revealed the parts of the formula i was looking for. 

Hope this helps someone else.

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 319 members 5,920 guests
Please welcome our newest community members: