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 vs. Update of Edits
Power Apps
Unanswered

Patch vs. Update of Edits

(0) ShareShare
ReportReport
Posted on by 5,331 Moderator

I have 'EditForm1'.

I have two buttons - 'Save Draft' and 'Submit'. In each button is the variable varPressed.
     - Save Draft button: UpdateContext({varPressed: "In Draft"});
     - Submit button: UpdateContext({varPressed: "Submit Update"});

There are several fields and controls I want evaluated for 'Save Draft' or 'Submit'

When I access an existing item and make a change, but don't complete the form, and use the 'Save Draft' button Power Apps creates another version of the item rather than overwriting the changes. I believe I need to add an 'If' that compares the List 'ItemID' to the 'ID' in EditForm1, but I am not sure where or how.

In the 'OnSuccess' of EditForm1 I have the following 'Switch' command.

Switch(
       varPressed,
       "In Draft",
       Patch(
              'TrackerList',
              {Status: {Value: "In Draft"}},

      "Submit Update",
      If(
          CombBox1.Seleted.Value = "In Draft" && Label6_3.Text = "Yes" && DataCardValue7_9.Selected.Value = "Other",
          Patch(
                'TrackerList',
                {Status: {Value: "Pending Approval"}})

Categories:
I have the same question (0)
  • SpongYe Profile Picture
    5,715 Super User 2026 Season 1 on at

    Hi @Phineas 

     

    The Patch function in "In Draft" is not completed:

    Your missing a ")" at the end of the line and ThisItem as a reference to the record to update. 

     

     

     

    Switch(
     varPressed,
     "In Draft",
     Patch(
     'TrackerList', ThisItem,
     {Status: {Value: "In Draft"}}),
    
     "Submit Update",
     If(
     CombBox1.Seleted.Value = "In Draft" && Label6_3.Text = "Yes" && DataCardValue7_9.Selected.Value = "Other",
     Patch(
     'TrackerList',
     {Status: {Value: "Pending Approval"}})

     

     

     

     Please try this and see if this works.

     


    ------------------------------------------------------------------------------------------------------------------------------
    If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

    If you like my response, please give it a Thumbs Up.

  • Phineas Profile Picture
    5,331 Moderator on at

    Probably because I have three more similar 'If' conditions in the "Submit Update" part of the switch.

    The statement ends with -
                )
           )
        )
    );

    There are no errors in the formula, it's just not updating the existing 'item', it is creating a new one with the same data with the 'Status' or 'In Draft'.

  • SpongYe Profile Picture
    5,715 Super User 2026 Season 1 on at

    @Phineas 

     

    Please change your patch and add ThisItem as a reference to the record:

    From

    Patch(
     'TrackerList',
     {Status: {Value: "In Draft"}}),

    To

     "In Draft",
     Patch(
     'TrackerList', ThisItem,
     {Status: {Value: "In Draft"}}),

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 101 Most Valuable Professional

#2
Haque Profile Picture

Haque 81

#3
VASANTH KUMAR BALMADI Profile Picture

VASANTH KUMAR BALMADI 70

Last 30 days Overall leaderboard