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 / Update context variabl...
Power Apps
Unanswered

Update context variable of another screen

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

How can I update the context variable of an another screen?

 

Here is a example of my workflow.

 

1. I am in my gallery and I click on the item which will call this Navigate(detail; ScreenTransition.None;{my_item: ThisItem});;

JeremieBergeron_0-1690549084375.png

 

2 I can see the detail of my item by doing my_item.X. 

JeremieBergeron_1-1690549244327.png

 

3. I click on the pen which call Navigate(mesure_preventive_edit_1; ScreenTransition.None;{my_item: my_item})

 

4. Now, I modified some value and I call this (I have also tried with an UpdateContext):

 

 Set(
 my_item;
 Patch(
 example;
 my_item;
 {
 example; "example"
 }
 )
 );;

 

 

But, when I go back to my detail view, I can still see the old value. This means that my_item hasn't been updated, but if I go in my SQL database, I can see that the record have been update.

 

In brief, browse screen â†’ detail screen â†’ edit screen

Categories:
I have the same question (0)
  • iAm_ManCat Profile Picture
    18,256 Most Valuable Professional on at

    Your gallery ThisItem is not refreshed when you patch, so your OnSelect is still using the value from before.

    Need to add in a refresh if you want the item to update.

    Refresh(datasourcename);;

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I tried, but after I edited my record, the detail view still contain the old data, so it doesn't seems to work

  • timl Profile Picture
    36,774 Super User 2026 Season 1 on at

    Hi @Anonymous 

    Just to avoid any confusion, let's modify the global variable that you set in mesure_preventive_edit_1 to "var_my_item".

     Set(
     var_my_item;
     Patch(
     example;
     my_item;
     {
     example; "example"
     }
     )
     );;
    

     

    In the button that returns you from detail to mesure_preventive_edit_1, if you set the OnSelect to the following, the data in detail should refresh.

     

    Navigate(detail; ScreenTransition.None;{my_item: var_my_item});;
    
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I tried this which didn't work since my_item isn't defined in mesure_preventive_edit_1.

     

     Set(
     var_my_item;
     Patch(
     example;
     my_item;
     {
     example; "example"
     }
     )
     );;

     

     
    I also tried this, but the detail view still contain the old data, so it doesn't seems to work:
     

     

     Set(
     my_item;
     Patch(
     example;
     var_my_item;
     {
     example; "example"
     }
     )
     );;

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I tried this which didn't work since my_item isn't defined in mesure_preventive_edit_1.

     

     Set(
     var_my_item;
     Patch(
     example;
     my_item;
     {
     example; "example"
     }
     )
     );;

     

     
    I also tried this, but the detail view still contain the old data, so it doesn't seems to work:
     

     

     Set(
     my_item;
     Patch(
     example;
     var_my_item;
     {
     example; "example"
     }
     )
     );;

     

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!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 538

#2
WarrenBelz Profile Picture

WarrenBelz 420 Most Valuable Professional

#3
Haque Profile Picture

Haque 305

Last 30 days Overall leaderboard