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 function Error f...
Power Apps
Answered

Patch function Error from Collection into SQL Table

(0) ShareShare
ReportReport
Posted on by

I'm having an Invalid Argument Type (Table). Expecting a Record Value instead error.

I have a SQL table with 27 columns but not all of it should be editable.

Only 5 or 6 columns are needed to be updated via Power Apps. 

 

I'm watching this tutorial on how to bulk update or add records into a SQL table.

Reza Dorrani 

I tried copying the part @11:00 and @14:00 of the video.

But when I try to apply it on my case, it is not working.

 

I have a gallery which user can edit specific columns each row and when they click "Done" an item will be added to a Collection like shown in the video.

Here's the content of my collection:

01 Patch.jpg

 

Here's my code of adding record inside the Collection.

02 Patch.jpg

 

Here's the Patch function inside my Save button

 

Patch(STAGING_LTC_BE_AUDIT,ShowColumns(colRowUpdates,'Auditor Name','Care Manager Name','Decision','Initial_Ongoing','IsEdited','Live_Post','Id'));

 

I tried also using

 

Patch(STAGING_LTC_BE_AUDIT,colRowUpdates);

 

But no luck.

 

I eventually realized this won't do because what if I need to add a whole new set of record and I can't restrict the insertion of columns only to 5 or 6.

So I decided to change this part and used ThisItem to add a record in the collection.

 

03 Patch.jpg

 

 

But when I look inside the Collection some column names are different

 

04 Patch.jpg

05 Patch.jpg

 

 

Not sure what are the next steps on this. 

Categories:
I have the same question (0)
  • Verified answer
    RazenC Profile Picture
    on at

    I managed to figure this one out. 

    It seems everytime we need to use Patch or Update you need your SQL tables to have a PRIMARY KEY in which I haven't added to the table I'm using the PATCH function into. 

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 June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 325 Most Valuable Professional

#2
11manish Profile Picture

11manish 165

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 88 Super User 2026 Season 1

Last 30 days Overall leaderboard