cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Community Support
Community Support

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

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

Highlighted
Community Support
Community Support

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

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

Join the new Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

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!

Top Solution Authors
Users online (7,664)