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 command error - ...
Power Apps
Answered

Patch command error - Invalid argument

(0) ShareShare
ReportReport
Posted on by

Hi all,

 

I have a power app that is being used by our business.

 

I have created a simple feedback page with a Input text field and Submit button.

 

I believe the patch command is the correct command to take the text that is inputted and enter it into a SharePoint list.

 

However I get formula error , The function 'Patch' has an invalid argument.

 

 

 Patch(
 PowerAppFeedback,
 Defaults(PowerAppFeedback),
 {
 TimeLogged: Text( Now(), "mm/dd/yyyy hh:mm:ss"),
 Comment: FeedbackInput.Text,
 Employee: 
 {
 '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
 Claims: "i:0#.f|membership|" & currentUser.Email,
 Department: "",
 DisplayName: currentUser.FullName,
 Email: currentUser.Email,
 JobTitle: "",
 Picture: ""
 }
 
 }
 );
Set(
 successMessage,
 "Feedback Submitted"
);Refresh(Feedback); 
Navigate(Success)

 

 

 

Any help will be appreciated.

Categories:
I have the same question (0)
  • BCLS776 Profile Picture
    8,994 Moderator on at

    There are several places where your Patch could have an issue, and it is most likely with a reference to a control's value. Could you share a screenshot of the error message and where in the statement the editor is flagging the problem?

     

    Also, you may want to consider different logic around your Set() statement. As it stands now, it will execute no matter what happens with the Patch().

     

    Bryan

  • Verified answer
    v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi @JOSHAX112,

    Have you solved your problem?

    Could you please tell me that if TimeLogged is a Date and time column or Text column?

     

    If TimeLogged is a Date and time column, you could not use the Text() to save the format data string. To change the data time display format, you could only change it in your SharePoint Site Settings>Regional Settings.

    By default, SharePoint Sites display the dates in US format (MM/DD/YYYY). So just choose the correct region as yours expected data display format.

     

    In addition, you could consider removing your currentUser(guess it is a variable) and replace it with User() instead.

     Patch(
     PowerAppFeedback,
     Defaults(PowerAppFeedback),
     {
     TimeLogged: Now(),// Assume that you have a Date and time column
     Comment: FeedbackInput.Text,
     Employee: 
     {
     '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
     Claims: "i:0#.f|membership|" & User().Email,// Try to replace with User().
     Department: "",
     DisplayName: User().FullName,
     Email: User().Email,
     JobTitle: "",
     Picture: ""
     }
     
     }
     );
    Set(
     successMessage,
     "Feedback Submitted"
    );Refresh(Feedback); 
    Navigate(Success)

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
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 207 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 150 Super User 2026 Season 2

Last 30 days Overall leaderboard