cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Community Support
Community Support

Re: Validate input text is exists in the table

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
Highlighted
Super User III
Super User III

Re: Validate input text is exists in the table

Hi @neethup 

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

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

Re: Validate input text is exists in the table

@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

Highlighted
Super User III
Super User III

Re: Validate input text is exists in the table

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. 

Highlighted
Community Support
Community Support

Re: Validate input text is exists in the table

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

Highlighted
Helper IV
Helper IV

Re: Validate input text is exists in the table

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

Highlighted
Helper IV
Helper IV

Re: Validate input text is exists in the table

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

Highlighted
Community Support
Community Support

Re: Validate input text is exists in the table

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.
Highlighted
Helper IV
Helper IV

Re: Validate input text is exists in the table

formula.pngformula1.png

Highlighted
Helper IV
Helper IV

Re: Validate input text is exists in the table

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

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