cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
DeleteSystem32
Level: Powered On

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
Dual Super User
Dual Super User

Re: Check if Inputfield contains string value of another inputfield

Hi @DeleteSystem32 

 

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
Dual Super User
Dual Super User

Re: Check if Inputfield contains string value of another inputfield

Hi @DeleteSystem32 

 

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

DeleteSystem32
Level: Powered On

Re: Check if Inputfield contains string value of another inputfield

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
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (6,329)