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 / Unable to PATCH to SQL...
Power Apps
Answered

Unable to PATCH to SQL table from PowerApps

(0) ShareShare
ReportReport
Posted on by 216
Hi,
I have a canvas PowerApp that connects to a SQL table.  I am unable to Patch to the table.  The code is as follows:
Patch(RentalRatingCategories, Defaults(RentalRatingCategories),
{Licesnse_Plate_Number:ThisItem.Licesnse_Plate_Number,  
Created_At_NZT:ThisItem.Created_At_NZT,
Name:ThisItem.Name,
Category:"Clean Car",
Comment:ThisItem.Comment});
The patch function exists in a gallery on an Icon's OnSelect property.
 
//Submit Data
Notify("Your request for a CLEANING service has been submitted",NotificationType.Success);
 
The error is: 'The function PATCH function has some invalid arguments.'
We have checked the credentials of the gateway, removed and reloaded the connection in Powerapps.
The table has an IDENTITY column and a PRIMARY KEY.
I am the db.owner of the table.
I can read but cannot write to the table.
Any suggestions?
Kind Regards
 
 
Rene Voller
 
Categories:
I have the same question (0)
  • Suggested answer
    Michael E. Gernaey Profile Picture
    53,976 Moderator on at
    Hi,
     
    I am assuming this doesn't work in Dev either so please do the following.
     
    IF you have published the app, even in dev, then follow these steps. If not the first step will change
     
    1. Go to your Apps Tab in your environment
    2. Go to your App in the list and click the ...
    3. Click Details then click Live Monitor
     
    This will open a tab in your browser. Let it load and do its thing for a moment.
     
    4. Then click Play Published App
     
    5. It will open a second tab where it will load your app
    6. Cause your error to happen in your app by doing whatever you need to do and leave the app running
    7. Go back to your Monitor Tab
    8. In the top right corner in the Filter, type Error 
    this will not filter the list for any errors.
    Now the thing about Monitor and errors, is that an error never just returns 1 line, cause.. you know gotta be fancy
     
    However, only 1 line, when clicked, and when you open the Properties (right side window), will show 4 Tabs, with the last Tab called Response
     
    In response tab, you will see JSON, with Header and Body. Both will be closed initially. Open the Body one.
     
    In there you should see much more information about your error, and it will tell you how to solve it.
     
    Feel free to paste it here if you need help.
     
    Thanks
  • Verified answer
    RVoller Profile Picture
    216 on at
    Hi Michael,
    Many thanks for your reply.
    I got it to work.  The issue was linked to the table itself. 
    To solve:
    I dropped the table. 
    Then re-created it with IDENTITY and PRIMARY KEY again.
    I then waited a 'Microsoft Minute' before I refreshed the datasources and refreshed the app.
    Created a new gallery and it worked.
    I 'suspect' the issue may be with the PowerApps cache that was not refreshed locally.
    Kind regards
    Rene Voller

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!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 522

#2
WarrenBelz Profile Picture

WarrenBelz 437 Most Valuable Professional

#3
Vish WR Profile Picture

Vish WR 405

Last 30 days Overall leaderboard