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
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (26,717)