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 / Set default triggers o...
Power Apps
Answered

Set default triggers on change in wrong order

(0) ShareShare
ReportReport
Posted on by 195

Hi all

 

I have a gallery, and in that gallery is an edit button. Part of the code in that edit button sets a "HasChanged" variable to false. Other buttons then do slightly different things depending on whether the user has actually made any changes to the data.

 

It also sets a number of other variables, and resets a bunch of text inputs with defaults set to those variables.

 

The text inputs all have an on change code that sets the "HasChanged" variable to true.

 

The problem I am having is if I click the edit button, it sets all the variables as it should, resets all the text inputs and sets the "HasChanged" to false, but even with the "HasChanged" Set at the end of the edit button code, the text inputs reset to defaults after the button code ends and reset the "HasChanged" to true, despite no actual change being made.

 

Anyone come across anything similar before and have a non-janky workaround (I know I could do something like start a 1 second timer to reset "HasChanged" back to false after the defaults apply but there's gotta be a tidier way?)

Categories:
I have the same question (0)
  • Verified answer
    crispybits1977 Profile Picture
    195 on at

    Figured out a workaround in the end. On the text input on changes I added an IF so that instead of just saying  set"HasChanged" true it says:

     

    IF(every text input value = equivalent datasource value, set "HasChanged" false, set "HasChanged" true)

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
Haque Profile Picture

Haque 94

#2
WarrenBelz Profile Picture

WarrenBelz 82 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 38 Super User 2026 Season 1

Last 30 days Overall leaderboard