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

Text box content match with data source

 

Hi,

I have a data source "Region". Which contains some 5 regions like Asia, Europe and so on.. I need user to enter only one of those 5 regions in a text box. If user enter some new region then that particular text box should throw error. Is it possible? I also tried changing text box to drop down and linked to data source and that works fine but I need user to enter details in text box.

 

Thanks..

1 ACCEPTED SOLUTION

Accepted Solutions

Hello Gopi - 

 

Just so I understand the question. You need a way of somehow notifying the user when the provided input is invalid, the mentioned approach should work. 

 

1. If(IsBlank(LookUp(DS, 'First Name' = TextInput1.Text)), "Valid", "Invalid") means if the given input matched what exists in the datasource then it's valid, otherwise it is invalid.

2. This assumes there is a column named 'First Name' in the datasource. Are you sure it does?

3. What errors are you seeing?

4. What is your current locale?

 

Knowing answers to the above will help us guide you better.

 

Thanks

Murali

View solution in original post

10 REPLIES 10
Kudo Kingpin
Kudo Kingpin

Is there a datacard connected to the region field? If so you can put a textinputfield in that datacard with this function in your errortext:

 

If(Upper(TextInput.Text) = "Europe" || "Asia" || "Africa" || "America"; ""; "There was a mistake in your input")

 

and outputDelayed on your textinput set to true

Anonymous
Not applicable

It is not possible to mention the region names (Just example) in function as there can be more than 1000 rows. In that case what should I do?

You could make a table in excel with the regions in a list, named Regions with 'RegionName' as header of the table and add this table as static data.

Then you could put this in the error:

 

If(IsBlank(LookUp(Regions;TextInput.Text = RegionName)); "There is a fault in your input."; "")

 

This will take the text of the input and compare it to the table with all of the regions. If there is a match, it won't display a text, if there is no match, the text will be shown. 

Anonymous
Not applicable

Kindly find below pic and help me with it.. I need to type something manualy in the text input in case if that key word doesn't match with beside table record then I should get error message. 

 

Sorry in the pic I just wrote some text info with my mouse. I know which is not good.. 😞

 

Capture.PNG

So the following does not work?

 

If(IsBlank(LookUp('[dbo].Employee_Record]';TextInput2.Text = Firstname)); "There is a fault in your input."; "")

 

I have not worked with sql in powerapps before but I would assume you are referring to the wrong field in Firstname. The column name should be written without quotation marks (again, I'm not sure about this, try to see if it wants to autocomplete to the fieldname). But this only works if what you write is exactly how it's stored in your table. For example if you were to search 'stephanie' it would give an error because it would have to be 'Stephanie' in order for it to work

 

 

Edit:

You can try

If(IsBlank(LookUp('[dbo].Employee_Record]';TextInput2.Text = Title)); "There is a fault in your input."; "")

 

 

Anonymous
Not applicable

Sorry! ;-( tried all the three functions..Still doesn't work! 

 

Capture.PNGCapture1.PNGCapture2.PNG

Try using semicolons ';' instead of commas ','

I believe they changed that a few weeks ago

Anonymous
Not applicable

tried ;-(

 

Capture.PNG

Hello Gopi - 

 

Just so I understand the question. You need a way of somehow notifying the user when the provided input is invalid, the mentioned approach should work. 

 

1. If(IsBlank(LookUp(DS, 'First Name' = TextInput1.Text)), "Valid", "Invalid") means if the given input matched what exists in the datasource then it's valid, otherwise it is invalid.

2. This assumes there is a column named 'First Name' in the datasource. Are you sure it does?

3. What errors are you seeing?

4. What is your current locale?

 

Knowing answers to the above will help us guide you better.

 

Thanks

Murali

View solution in original post

Helpful resources

Announcements
secondImage

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

Top Kudoed Authors
Users online (38,116)