cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

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
Highlighted
New Member

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
Highlighted
Dual Super User III
Dual Super User III

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
Community Support

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.
Highlighted
New Member

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
FirstImage

Microsoft Ignite 2020

Check out the announcement of Power Platform content at Microsoft Ignite!

thirdImage

Experience what's new for Power Automate

Join us for an in-depth look at the new Power Automate features and capabilities at the free Microsoft Business Applications Launch Event.

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (5,588)