web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / UpdateContext works wi...
Power Apps
Unanswered

UpdateContext works without performing any action

(0) ShareShare
ReportReport
Posted on by 2

I have several screens, on two of them are display form and edit form

So the thing is: on display form I have a button which navigates me to edit form, and on edit form there is a button with onselect: UpdateContext({ButtonText: ", " & User().FullName}) and text field default: Parent.Default & ButtonText

When I go to edit screen for the first time, text field only has the value from its parent, then i press the button and to that value adds text from updatecontext. But when i go back to display screen and go to edit screen again, value from updatecontext adds without me pressing a button.

 

For example

First try

Text field: test

Press button

Text field: test, + value from updatecontext

 

Second try:

NO pressing button

Text field: test, + value from updatecontext, + another value from updatecontext

 

Is there a way to fix this?

Categories:
I have the same question (0)
  • SkiDK Profile Picture
    1,016 on at

    By screens, you mean different screens in Powerapps right? 

     

    If you switch screens UpdateContext will not work. It's a local variable that is not detectable in another screen. This means that in every screen you can have the same but personal variable that only works in it's own screen. When you now leave a screen en go back, the UpdateContext will be executed again on new screen since it did not reset. 

     

    If you want to pass variables between screens you'll have to use the Set(variable, value) method. This creates a global variable. Or somehow reset the UpdateContext somewhere when leaving screen, so it doesn't automatically get executed (adding another line of text) when going back to this screen. It should only execute when you click on the button.

     

    I hope this helps somehow

  • annaradio Profile Picture
    2 on at

    Yes, I mean different screens in Powerapps.

     

    Thanks for your response, but this is not exactly what I meant. I don't need to pass variables between screens. Let me try to explain. I have Screen1 and Screen2.

    Screen1 displays information and from it you can navigate to Screen2, where you can edit information. On Screen2 I have TextField and Button. Button onselect property is set to UpdateContext({ButtonText: ", " & User().FullName}), and TextField Default property is Parent.Default & ButtonText

     

    Here is what I do. I go from Screen1 to Screen2. On Screen2, press button and value of TextField is test(it was there before), FirstName LastName. Click Save.

    Then I go back to Screen1. After this I go to Screen2 again. And on Screen2, TextField value is test, FirstName1 LastName1(test and FirstName1 LastName1 is from previous pressing the button , FirstName2 LastName2. But after going to Screen2 I haven't pressed a Button.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard