cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
SylvieLet17
Level 8

Variable Contains String

Hi all, 

I have a flow that triggers when an Item is created or modified on a SharePoint List.

There is a Choice field with multiple selections enabled. 

I need to perform an action based on the choices selected in that field. 

I have tried this EVERY way I can think of. 

I set a condition: [MyField] contains 'MyString'

The condition returns false constantly. 

I tried Get Item, and setting the Choices in an Array Variable, then running the condition on that. Still false. 

I tried a compose action: Contains(body('Get_item')['MyField'],'MyString')   ...still false. 

It just can't find the string in the output even though it most certainly is there. 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Variable Contains String

Hi @SylvieLet17 ,

 

If the type of this field is Multiple selection of choice, please consider using the following method to determine whether the specified string value is included in the selected choice.

 

  • Initialize the array variable to store the choice value.
  • Configure Apply to each to iterate through the selected choice and append the choice value to the array variable.
  • Use Condition to determine if the variable contains the specified string value.

 

Image reference:

3.PNG4.PNG

 

Please take a try.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Willemijn
Level 8

Re: Variable Contains String

Hi @SylvieLet17 ,

 

In your dynamic content there is an item with Value behind it. You need that one, since it is a choice field you need to select the value to get the output of it.

 

Let me know if this helps, otherwise I will take another look.

Regards,

Willemijnimage.png

Community Support Team
Community Support Team

Re: Variable Contains String

Hi @SylvieLet17 ,

 

If the type of this field is Multiple selection of choice, please consider using the following method to determine whether the specified string value is included in the selected choice.

 

  • Initialize the array variable to store the choice value.
  • Configure Apply to each to iterate through the selected choice and append the choice value to the array variable.
  • Use Condition to determine if the variable contains the specified string value.

 

Image reference:

3.PNG4.PNG

 

Please take a try.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
firstImage

Power Platform Online Conference

Speakers, submit your sessions now! Call for speakers ends Feb. 10!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

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 Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (4,469)