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 / Patch Isn't Working in...
Power Apps
Answered

Patch Isn't Working in If Statement with Lookup

(0) ShareShare
ReportReport
Posted on by 17

Hi,

 

I'm trying to have a button set up that takes the text in a label and sees if it is in an SQL database.

 

If it is not, then it will add the text in that label (and the user's name and email as well) to the database. The error in the formula is within the patch statement, but if I put the same patch formula in a different button without the if or lookup statements then it works. 

 

I previously was successful adding a new value into a database using 'SubmitForm' and a text input, but I need it to add through a label as the user will select the values from dropdown lists and the label concatenates the dropdown values.

 

Any help will be much appreciated.

 

Thanks.

patcherror.PNG
Categories:
  • timl Profile Picture
    37,287 Super User 2026 Season 2 on at

    Hi @Mammoth

    I think it's possibly the AND statement that you have after the Patch. If you want to Patch a record and then show a notification, you can separate the calls to Patch and Notify with a semi-colon instead of AND.

  • scxttd Profile Picture
    17 on at

    Hi @timl,

     

    Taking out the AND Notify has worked, but I'm not sure what you mean by separating it with a semi-colon?

     

    Currently, if it already exists or NULL values are added then the error notification pops up (which is what I want). The user can also add the new value to the database but does not confirm to the user it has uploaded successfully. If I do separate it with a semi-colon and then add the success notification type, will that not always show a success regardless of the outcome?

  • Verified answer
    timl Profile Picture
    37,287 Super User 2026 Season 2 on at

    Hi @Mammoth

    Within the true part of an If statement, you can call multiple functions provided that each function call is terminated with an ; symbol.

    Therefore if you replace AND with ;  (ie terminate your call to Patch with ; before calling Notify), this means that when your If statement resolves to true, it will call Patch followed by Notify. In this case, the success notification will not always show, regardless of the outcome. Let me know if this makes a bit more sense to you.

     


     

  • scxttd Profile Picture
    17 on at

    @timl you are a legend...thank you Smiley Very Happy

  • timl Profile Picture
    37,287 Super User 2026 Season 2 on at

    Thanks @Mammoth, you're welcome!

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 395 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 260 Most Valuable Professional

Last 30 days Overall leaderboard