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..
Solved! Go to Solution.
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
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
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.
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.. 😞
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."; "")
Sorry! ;-( tried all the three functions..Still doesn't work!
Try using semicolons ';' instead of commas ','
I believe they changed that a few weeks ago
tried ;-(
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
User | Count |
---|---|
179 | |
113 | |
88 | |
44 | |
42 |
User | Count |
---|---|
225 | |
113 | |
112 | |
69 | |
67 |