cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper V
Helper V

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

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
Resolver III
Resolver III

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

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
PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Top Solution Authors
Users online (5,605)