Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building 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. 

  • Verified answer
    RazenC Profile Picture
    on at
    Re: Patch function Error from Collection into SQL Table

    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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,645 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,997 Most Valuable Professional

Leaderboard