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 statement error ...
Power Apps
Suggested Answer

Patch statement error to new SQL table?

(1) ShareShare
ReportReport
Posted on by 732
I created a new table on the Azure SQL server I use for all my apps today. Then I attempted to create a patch statement to put new records in. I have tried in multiple apps, and it always says there is an error in formula. I can read into a gallery from the table. I am totally stumped what I am doing wrong?
Categories:
  • WarrenBelz Profile Picture
    156,526 Most Valuable Professional on at
    Just to eliminate something here, can you try patching to different column with a name not starting with a number - a text column would be ideal. Also try removing and re-connecting the SQL table to reset the connector.
     
    Please Does this answer your question 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 answering Yes to Was this reply helpful? or give it a Like
    Visit my blog
    Practical Power Apps    LinkedIn  
     
     
  • Suggested answer
    11manish Profile Picture
    4,617 Super User 2026 Season 2 on at
    Patch() isn't inherently wrong here. Read access proves the connection can query the table, but write access requires the SQL table to have a suitable key/schema and the connection identity to have INSERT capability. For a newly created Azure SQL table, primary key + refreshed Power Apps schema are the first two things to check.
  • Suggested answer
    Haque Profile Picture
    4,197 Super User 2026 Season 2 on at
     
    Would it be possible to share the schema details of the table? One more thing, the exact error message Power Apps shows when we try to patch?
     
     

    One part is good that the reading of data works but patching does not, I suspect the following areas:

    Suspected Area-1: The designated table might have a required column I consider primary key also or non-nullable fields that must be included in patch statement.  If you only patch {iPadNum:2} but other required columns are missing, the patch will fail.

    Suspected Area-2: The column iPadNum must be numeric and match the data type you’re patching. Are we passing string if it expects int?

    Suspected Area-3: Again, as we can read data but write fails, the connection might have read permission but not insert/update permission on the table!

    Suspected Area-4: Sometimes Azure SQL tables require fully qualified names, for example, if table name is TestingTable is in the default schema dbo, the fully qualified name would be: dbo.TestingTable.

     

    Meanwhile, a common approach to patching Azure SQL table is to include all required fields and the primary key (if updating), for example:

    Patch(
        TestingTable,
        Defaults(TestingTable),
        {
            iPadNum: 2,
            -- Let's include other required columns here with appropriate values
        }
    )
    
     
     
     

    I am sure some clues I tried to give. If these clues help to resolve the issue brought you by here, please don't forget to check the box Does this answer your question? At the same time, I am pretty sure you have liked the response!

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 393 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 278 Most Valuable Professional

Last 30 days Overall leaderboard