web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Validate input text is...
Power Apps
Answered

Validate input text is exists in the table

(0) ShareShare
ReportReport
Posted on by 52

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?

Categories:
I have the same question (0)
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    Hi @neethup 

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

    Search(datasource, Textinput.Text, “Column1”, “Column2”, etc.)
  • neethup Profile Picture
    52 on at

    @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

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    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. 

  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    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,

  • neethup Profile Picture
    52 on at

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

  • neethup Profile Picture
    52 on at

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

  • v-xida-msft Profile Picture
    Microsoft Employee on at

    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,

  • neethup Profile Picture
    52 on at

    formula.pngformula1.png

  • neethup Profile Picture
    52 on at

     

    @v-xida-msft form2.png

  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @neethup ,

    Could you please share a bit more about the ClientID column in your SQL Table? Is it a Number type column or Text type column?

     

    Currently, I could not reproduce your issue on my side.

    If the ClientID is a Number column in your SQL Table, please consider modify your formula as below:

    If(
     IsBlank(LookUp('[dbo].[CUSTOM_cmClient]', ClientID = Value(DcClientID.Text))), /* <-- If the ClientID is a Number type column in your SQL Table */
     Set(ShowErrorMsg, false),
     Set(ShowErrorMsg, true)
    )

    In addition, I also think a Timer control could achieve your needs. Add a Timer control in your app, set the Duration property to following:

    1000

    Set the AutoStart property and Repeat property to following:

    true

    Set the OnTimerEnd property to following:

    If(
     IsBlank(LookUp('[dbo].[CUSTOM_cmClient]', ClientID = Value(DcClientID.Text))), /* <-- If the ClientID is a Number type column in your SQL Table */
     Set(ShowErrorMsg, false),
     Set(ShowErrorMsg, true)
    )

    Set the Visible property of the Timer control to following:

    false /* <-- Hidden the Timer control */

     

    Set the Visible property of the Error Message Label to following:

    ShowErrorMsg

    Best regards,

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 482 Most Valuable Professional

#2
11manish Profile Picture

11manish 459

#3
Haque Profile Picture

Haque 331

Last 30 days Overall leaderboard