Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

OnChange() issue with 2 connected text inputs

(0) ShareShare
ReportReport
Posted on by

I have 2 input boxes:

 

TextInput1

Default: testVar1

OnChange: Set(testVar2,Value(TextInput1.Text)*2)

 

TextInput2

Default: testVar2

OnChange: Set(testVar1,Value(TextInput2.Text)/2)

 

Default:

RobinW_0-1689277699577.png

I change the 2nd box to 3 and the 1st box automatically changes to 1.5

RobinW_1-1689277728271.png

I change the 1st box to 2 and the 2nd box automatically changes to 4

RobinW_2-1689277744097.png

 

This works perfectly, however in my 2nd example:

Default:

RobinW_3-1689277889924.png

I change the 2nd box to 3 and the 1st box automatically changes to 1.5

RobinW_4-1689277943773.png

I change the 1st box back to 1, but the 2nd box stays at 3

RobinW_5-1689277967388.png

 

I'm guessing that the 1st box OnChange doesn't register because I didn't manually set it to a different value even though the formula changed it to a different value. Is there a workaround to this issue?

  • Verified answer
    RobinW Profile Picture
    on at
    Re: OnChange() issue with 2 connected text inputs

    I ended up finding a solution. Add a Reset() function to the end of OnChange.

     

    TextInput1

    Default: testVar1

    OnChange: Set(testVar2,Value(TextInput1.Text)*2); Reset(TextInput2);

     

    TextInput2

    Default: testVar2

    OnChange: Set(testVar1,Value(TextInput2.Text)/2); Reset(TextInput1);

  • Verified answer
    WarrenBelz Profile Picture
    146,645 Most Valuable Professional on at
    Re: OnChange() issue with 2 connected text inputs

    Hi @RobinW ,

    That is because OnChange only triggers when the user physically changes that value (not when a Variable that happens to be the Default changes)

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,645 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,997 Most Valuable Professional

Leaderboard