web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Invalid arguments in P...
Power Apps
Suggested Answer

Invalid arguments in Patch function

(1) ShareShare
ReportReport
Posted on by 33
I am new to building power apps. As a POC I have built a form that a user can fill out based on existing records in a SQL db.
 
One feature is that the user can transfer the record to another user in our business for them to complete.
 
 
The error I am getting is "The function 'Patch' has some invalid arguments."
 
Column names are character perfect so it cannot be that.
 
transferCmb is a combo box for picking a user. galLBSurvey is a gallery of records in the SQL table called CancelledYesterdayAnswers.
 
Any help appreciated.
Categories:
I have the same question (0)
  • timl Profile Picture
    36,466 Super User 2025 Season 2 on at
    Hi mpeggie
     
    Can you confirm that there's a primary key in your CancelledYesterdayAnswers table?
     
    It looks like PolicyRef is the unique identifier for your table - if that isn't defined as a primary key in SQL Server, that can cause a patch error.
     
  • CU02120957-0 Profile Picture
    33 on at
    Hi timl,
     
    The table does not have a primary key.
     
    This is why I am using the First() for selecting the record.
     
    Is this the cause of the error?
  • Nandit Profile Picture
    1,568 Moderator on at
    Hi mpeggie,
     
    timl is correct! You need to add a Primary key to your table and that will solve the problem for you. 
     
    Kind regards, 
    Nandit
     
  • Suggested answer
    timl Profile Picture
    36,466 Super User 2025 Season 2 on at
    Hi mpeggie,
     
    Yes, if there's no primary key on a table, Power Apps won't be able to add or modify rows in the table because it doesn't know how to uniquely identify the records.  
     
    Calling First() doesn't help (as you've discovered).
     
    Defining PolicyRef as the primary key should resolve this patch error.
  • CU02120957-0 Profile Picture
    33 on at
    Thank you, will assume correct as both of you have stated. Doing some work around the data architecture so will be able to fix this later today. Will mark correct when all solved. Thanks again!

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 699 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 325 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 248

Last 30 days Overall leaderboard