cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SylvieLet17
Responsive Resident
Responsive Resident

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
v-bacao-msft
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
Willemijn
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

v-bacao-msft
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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (1,848)