cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper IV
Helper IV

Validate input text is exists in the table

Hi.. how can i check the input text is exists in the table.. I have tried lookup function in the onchange but its not working.. if its not exists i want to show validation like not exist too.. can anybody help?

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Hi @neethup ,

Do you want to check if the entered Text value existed in your data source already?

Could you please share a bit more about the LookUp formula in your app?

 

Based on the needs that you mentioned, I think the OnChange property of the Text Box and the LookUp function could achieve your needs.

 

I have made a test on my side, please take a try with the following workaround:1.JPG

 

2.JPG

Set the OnChange property of the Text Input box (TextInput1) to following:

If(
   IsBlank(LookUp('20190701_case7', Title=TextInput1.Text)),
   Set(ShowErrorMsg, false),
   Set(ShowErrorMsg, true)
)

On your side, you may need to type the following:

If(
   IsBlank(LookUp('YourDataSource', FilteredColumn = TextInput1.Text)),   /* <-- FilteredColumn represents the column in your data source, which you want to compare with the Text Input value */
   Set(ShowErrorMsg, false),
   Set(ShowErrorMsg, true)
)

Add a Error Message Label under above Text Input box, set the Text property to a error message you want to display. e.g.

"The value you typed has been existed, please re-type a new one!"

set the Visible property of the Label to following:

If(ShowErrorMsg, true, false)

Please check the following GIF screenshot for more details:Test.gif

 

Best regards,

Community Support Team _ Kris Dai
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

11 REPLIES 11
Super User II
Super User II

Hi @neethup 

The Filter is in the Items property of the data table. For example,

Search(datasource, Textinput.Text, “Column1”, “Column2”, etc.)

@Drrickryp  I dont want to filter datatable.. i have a textbox field if i input something it should check the input text is exist in the table or not

Hi @neethup 

Put a label field on the screen.  Set it's Text property to IsEmpty(Search(table,TextInput1.Text,"Column1","Column2",etc).  In order to search a table, you need to define which columns of data need to be searched.   The Textbox will return false if the text in the textinput control is found in one of the columns you are searching.  If the text is not found, it will return true. 

Community Support
Community Support

Hi @neethup ,

Do you want to check if the entered Text value existed in your data source already?

Could you please share a bit more about the LookUp formula in your app?

 

Based on the needs that you mentioned, I think the OnChange property of the Text Box and the LookUp function could achieve your needs.

 

I have made a test on my side, please take a try with the following workaround:1.JPG

 

2.JPG

Set the OnChange property of the Text Input box (TextInput1) to following:

If(
   IsBlank(LookUp('20190701_case7', Title=TextInput1.Text)),
   Set(ShowErrorMsg, false),
   Set(ShowErrorMsg, true)
)

On your side, you may need to type the following:

If(
   IsBlank(LookUp('YourDataSource', FilteredColumn = TextInput1.Text)),   /* <-- FilteredColumn represents the column in your data source, which you want to compare with the Text Input value */
   Set(ShowErrorMsg, false),
   Set(ShowErrorMsg, true)
)

Add a Error Message Label under above Text Input box, set the Text property to a error message you want to display. e.g.

"The value you typed has been existed, please re-type a new one!"

set the Visible property of the Label to following:

If(ShowErrorMsg, true, false)

Please check the following GIF screenshot for more details:Test.gif

 

Best regards,

Community Support Team _ Kris Dai
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

@v-xida-msft  Thank you so much.. I will try this

@v-xida-msft  Hi., i have tried this but nothing is getting worked.. not even showing error message

Hi @neethup ,

Could you please share a bit more about your formula?

Could you please share a screenshot about it?

 

Please note that the OnChange property of the Text Input box would be fired only when you move the mouse focus from the Text Input box to other place in your app.

 

Currently, I could not reproduce your issue on my side, please check if you have typed proper formula within your app. Also please consider re-create a new app, then try above solution again.

 

Note: Please make sure the Network is in good condition on your side.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

formula.pngformula1.png

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 Solution Authors
Top Kudoed Authors
Users online (43,868)