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 / Gathering only unsaved...
Power Apps
Answered

Gathering only unsaved variables in a form

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello all!
I am trying to only gather variables in a form that have changed and am finding that the property Updates will return a variables existing value, even if it hasn't changed..

My understanding is that using the Unsaved property returns a boolean value if any of the variables in a form have changed, and the Updates property will return the new/updated value or the existing value if it has not changed. Is there a way to only return the values that have changed?

So far it looks like I am going to have to create a boolean variable for each field of my form and compare the DataCard value against the selected item's existing value? This isn't too big of an issue but I would think there would be an easier way to go about it..?

Any suggestions are appreciated!

Matt

Categories:
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    This is not easily done with the form.  It is a very manual process.  There are a variety of ways to go about it.  All depends on your scenario.  

    What kind of actions do you anticipate doing based on knowing what fields have changed on a form?

     

  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @RandyHayesThanks for the reply! We have a ticketing system I wanted to create a change log for.. I am not interested using the versioning options SharePoint has to offer, so I wanted to try and create one.

    I've actually got this working already, but as you pointed out, it is a very manual process with a lot of moving parts.. Here is how I got it working:

    For each variable in the form, I am using the OnChange function to set a boolean if the variable of the textbox/drop-down does not match the existing value. Then I use each boolean to build a string by returning the value of only the changed variables. I then reset each boolean once I have submitted the form.

    This is working for now but I imagine it will become a monster to manage the more the form grows.

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    Yeah, that's one way.  I would personally avoid variables at all cost for this as you have to constantly maintain them by setting them all over the place.

     

    A method to consider for making this dynamic is to utilize a toggle control in the datacard.  From that you can have the toggle build either a usable string of changes or a collection of changed items.  I've done this method before and it works well and is pretty easy to maintain.  There does come a point where you have to manually translate that back to columns in a datasource though.  Or, you can also use it as a change log column in the exiting datasource and form.

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    I was trying to bring up an example app that I had that demonstrated this concept I was talking of...and then we had the PowerApp (and more) outage.

    Anyway, here is a screenshot of the concept I mentioned.

    Key parts : 1) a toggle in all of the datacards (hidden) that senses changes and records the datafield and original value in a string variable.  2) a dynamic variable that gets real time form information for values in a table.  All the rest is just data formatting/shaping. 

     

    Top is the Form.  Middle is just a Gallery to demonstrate showing in a gallery.  Bottom is Html text to show formatted for a log or email, etc.

     

    formChanges.gif

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 243 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 204 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 122

Last 30 days Overall leaderboard