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 just the field t...
Power Apps
Answered

Patch just the field that have changed

(1) ShareShare
ReportReport
Posted on by 160
I am not using a form I have a series of input text boxes on a screen, and I use Patch to add the data.
 
I have an edit screen with all the controls on it but I don't want to patch all of the controls if only a few have changed. Specifically, I have "Status" control that I trigger a flow on but every time a patch it triggers that Power Automate flow be it is seeing it as having changed.

I am trying to think of a way to track which controls actually had data change in them. I through about adding a collection and collecting each control independently but then I'd have to run a patch statement in a ForAll loop which doesn't seem to make sense.
 
Can I get some recommendation on tracking which controls are changed?
Categories:
I have the same question (0)
  • Pstork1 Profile Picture
    69,556 Most Valuable Professional on at
    Unless you are using a Trigger Condition the flow triggers when anything in the record changes. To get it to only trigger when the status changes you have to track both the current status and the previous status and use a Trigger condition to keep the trigger from firing if those two fields are the same.

    ----------------------------------------------------------------------------------
    If this Post helped you, please click "Does this answer your question" and give it a like to help others in the community find the answer too!

    Paul Papanek Stork, MVP
    Blog: https://www.dontpapanic.com/blog
     
  • Suggested answer
    Kalathiya Profile Picture
    2,456 Super User 2026 Season 1 on at

    You generally do not need to track every changed control separately using collections. Much simpler way is to compare the current control value against the original record value before patching.

    Try this appraoch:

    // OnSelect of your Save button
    Patch(
        YourDataSource,
        LookUp(YourDataSource, ID = Gallery.Selected.ID),
        {
            // Status only patches if it changed, it won't trigger flow unless changed
            Status: If(
                ddStatus.Selected.Value <> Gallery.Selected.Status,
                ddStatus.Selected.Value,
                Gallery.Selected.Status        // Pass old column value
            ),
    
            // Same for all other fields
            CustomerName: If(
                txtCustomerName.Text <> Gallery.Selected.CustomerName,
                txtCustomerName.Text,
                Gallery.Selected.CustomerName
            )
        }
    )
    Note: Please make sure Control Name, List Name and Column Name replace as per yours. 
     
    If this response resolves your issue, please mark it as the Verified Answer so it can help other community members as well.
    ---------------------------------------------------------------------------------

    📩 Need more help? Just mention @Kalathiya and I’ll be happy to assist.

    ✔️ If this answer helped you, please tick “Does this answer your question?” so it can be marked as the Verified Answer.

    💛 A Like always motivates me to keep contributing!

    ​​​​​​​
  • Verified answer
    Ram Prakash Duraisamy Profile Picture
    5,877 Super User 2026 Season 1 on at
     
    You can give a try like below
     
    Set(
        varUpdates,
        {}
    );
    If(
        txtName.Text <> varOriginal.Name,
        Set(
            varUpdates,
            Patch(varUpdates, {Name: txtName.Text})
        )
    );
    If(
        drpStatus.Selected.Value <> varOriginal.Status,
        Set(
            varUpdates,
            Patch(varUpdates, {Status: drpStatus.Selected.Value})
        )
    );
    If(
        txtDescription.Text <> varOriginal.Description,
        Set(
            varUpdates,
            Patch(varUpdates, {Description: txtDescription.Text})
        )
    );
    Patch(
        MyTable,
        varOriginal,
        varUpdates
    );
     
    Please mark as answer if my suggestion helps.
    Subscribe here for More Useful videos : https://www.youtube.com/@rampprakash3991
  • FW-07051511-0 Profile Picture
    160 on at
     
    I think you got the correct approach but I got and error in the patch statement that doesn't make sense. See image below.

    I am patching to the SharePoint Tasks list and there is clearly a column in the list named 'Status Set By' but the Patch statement doesn't like it. The 'Status Set By' is a People column in SharePoint, see the second image of my variable I set.
     
     
     
     
     
     
  • FW-07051511-0 Profile Picture
    160 on at
    In the Patch statement wherever there was a column name with spaces I replaced it with the internal name of the column. That seems to have solved my error. 

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 424

#2
WarrenBelz Profile Picture

WarrenBelz 355 Most Valuable Professional

#3
11manish Profile Picture

11manish 290

Last 30 days Overall leaderboard