cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Check if Inputfield contains string value of another inputfield

Hello

 

I made a litte project to clarify my question:

 

Is Match.png

 

When the (is match?) Button is pressed the MatchLabel (green) will get the value of matchVar which is either "match" or "no match". This depends on if the two MatchInput fields have an equal text or not. This works fine.

 

My Problem:

I cannot check if the ContainsIputLeft contains the value of ContainsInputRight which I do like this:

IsMatch(ContainsInputLeft.Text;ContainsInputRight.Text;MatchOptions.Contains & IgnoreCase)

 

IsMatch() needs a String as second Parameter which looks like this:

contains.png

However now I always check if the ContainsInputLeft Inputfield contains a "p" and not the value of ContainsInputRight like it should be.

 

Anyone any Ideas on how to check if a value of an inputfield is included in an value of another inputfield?

1 ACCEPTED SOLUTION

Accepted Solutions
yashag2255
Dual Super User II
Dual Super User II

Hi @Anonymous 

 

You can use the expression as:
 
Ignore case: If(Lower(TextInput2.Text) in Lower(TextInput1.Text),Set(containsVar,"Contains"),Set(containsVar, "DoesNot COntain"))
 
Does Not ignore Case: If(TextInput2.Text in TextInput1.Text,Set(containsVar,"Contains"),Set(containsVar, "DoesNot COntain"))
 
Here, TextInput2 is the control that contains value like "p" and TextInput1 will be the text where you want to find the textinput2 value.
 
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

2 REPLIES 2
yashag2255
Dual Super User II
Dual Super User II

Hi @Anonymous 

 

You can use the expression as:
 
Ignore case: If(Lower(TextInput2.Text) in Lower(TextInput1.Text),Set(containsVar,"Contains"),Set(containsVar, "DoesNot COntain"))
 
Does Not ignore Case: If(TextInput2.Text in TextInput1.Text,Set(containsVar,"Contains"),Set(containsVar, "DoesNot COntain"))
 
Here, TextInput2 is the control that contains value like "p" and TextInput1 will be the text where you want to find the textinput2 value.
 
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

Anonymous
Not applicable

Wow thanks for the fast reply!

 

This is a awesome solution thank you!

 

I was worried that it would be case sensitive but its NOT.

 

Have a nice day!

 

 

 

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

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.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (2,923)