Skip to main content
Community site session details
Power Apps - Building Power Apps
Answered

How to check if values in text box match data source

Like (0) ShareShare
ReportReport
Posted on 25 Dec 2021 10:54:30 by 55

Hello all!

 

So I have an application where a user inputs the phone number of a customer to save in the database, but having duplicate phone numbers is not allowed. I figured out how to warn the user that the phone number already exists using If function, but I would also like to show the user in a gallery all the information of the customer's typed phone number (Name, Notes, Email, Phone: All this information is present in a data source.) and this should be done only after clicking a button. This button is the same that warns the user about a duplicate find.

  • Verified answer
    WarrenBelz Profile Picture
    149,102 Most Valuable Professional on 25 Dec 2021 at 11:34:00
    Re: How to check if values in text box match data source

    @sergeasmar97 ,

    Going back to your previous post - one modification

    UpdateContext(
     {
     varLead:
     LookUp(
     Leads,
     LeadPhone=txtContactPhone.Text
     )
     }
    );
    If(
     !IsBlank(varLead.LeadPhone),
     Notify("Warning, phone number found. Submit again?",Information);
     UpdateContext({varResubmit:true}),
     Patch(
     Leads,
     Defaults(Leads),
     {LeadPhone:txtContactPhone.Text}
     );
     UpdateContext({varResubmit:false})
    )

    All the details could then be shown on labels - varLead.Name, varLead.Notes, varLead.Email, varLead.LeadPhone

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

Helpful resources

Quick Links

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 637 Most Valuable Professional

#2
stampcoin Profile Picture

stampcoin 570 Super User 2025 Season 2

#3
Power Apps 1919 Profile Picture

Power Apps 1919 473

Loading complete