cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
kilaj1
Resolver I
Resolver I

Query multi choice SPO field to send email

I have a workflow that gets triggered on creation of a item on a SPO list. This list has a multi-choice field called "Required Event Support".  You ahve the option of selecting multiple entries. 

 

I need to be able to use PowerAutomate to send an email to the submitter, in a section of this email I need to add specific text based on what was selected in the "Required Event Support".  If it was say option a and option d, the email notification will be appended with special notes for options A and D.

 

I've managed to parse the data out using "Append to Array" and the "Select" functions

kilaj1_0-1653006493427.png

Choices produces 

[
  "No support required",
  "E-B",
  "Gift A",
  "Socials"
]

And the "Select" output is 

[
  {
    "Value": "No support required"
  },
  {
    "Value": "E-B"
  },
  {
    "Value": "Gift A"
  },
  {
    "Value": "Socials"
  }
]

I've tried a IF + Contains formula to trigger an initialization of the variable with the specific text

similar to this if(contains(body('Select'),'E-B'),Yes,No), but this is not returning results.

 

I need to have PowerAutomate look through the above array and see that E-B was selected and then initialize the variable 

1 REPLY 1
Expiscornovus
Super User
Super User

Hi @kilaj1,

 

After the Select you could use a Filter Array action and check if the outputs is empty of that filter array action. If that is the case it has not found a match.

 

Below is an example.

 

After that Filter Array you could use an expression like below to check if empty.

if(empty(body('Filter_array')), 'Yes','No')

 

filterarrayaction_checkitemvalue.PNG



Happy to help out! 🙂

Interested in more #PowerAutomate #SharePointOnline or #PowerVirtualAgents content?
Visit my blog, Subscribe to my YouTube channel or Follow me on Twitter


Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (1,387)