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 Platform Community / Forums / Power Apps / Form not updating with...
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)
Categories:
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

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 757 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 322 Super User 2025 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 209 Super User 2025 Season 2

Last 30 days Overall leaderboard