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

Community site session details

Session Id :
Power Apps - Building Power Apps
Unanswered

Form not updating with Patch

(0) ShareShare
ReportReport
Posted on by 43

I have created a form using various controls such as text input, date picker & togs as this provided more flexibility compared to the traditional forms. I have created a patch command within the OnSelect for the Save button. All the new records which are entered save without any issues, However when i try to amend a existing record. I get the following error message and the form resets and then the amended data is not saved

AndrewK93_0-1716988255947.png

 

 

Patch command is as follows

Patch(
    Accounts,
    If(IsBlank(varAccount), Defaults(Accounts), varAccount),
    {
        Title:varUserID,
        Domain:
            {
                Value: ddDomain.SelectedText.Value,
                Id: LookUp(Domain, Title = ddDomain.SelectedText.Value).ID
            },
        'Account Name': txtAccountName.Text,
        'Request Number': txtReqNo.Text,
        'Last Reviewed':LastReviewed_Date.SelectedDate,
        Approver: {
            '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
            Claims: "i:0#.f|membership|" & cbApprover.Selected.Mail,
            DisplayName: cbApprover.Selected.DisplayName,
            Email: cbApprover.Selected.Mail,
            Department: "",
            JobTitle: "",
            Picture: "" // Optional: Include additional user properties as needed
        },
        'Account Required': AccReq_Tog.Value
    }
);
Reset(ddDomain); Reset(txtAccountName); Reset(txtReqNo); Reset(LastReviewed_Date); Reset(cbApprover);  Reset(AccReq_Tog)
I have the same question (0)
  • anandm08 Profile Picture
    1,936 Super User 2024 Season 2 on at
    Re: Form not updating with Patch

    hi @AndrewK93 

    try to remove the data source and re-add again.

  • AndrewK93 Profile Picture
    43 on at
    Re: Form not updating with Patch

    Remove which bit of the code? There are no errors within the formula. 

  • anandm08 Profile Picture
    1,936 Super User 2024 Season 2 on at
    Re: Form not updating with Patch

    hi @AndrewK93 ,

    what is in varAccount variable? could you explain?

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 629 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 397 Super User 2025 Season 2

#3
wolenberg_ Profile Picture

wolenberg_ 232 Moderator

Last 30 days Overall leaderboard