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
    37,210 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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 426

#2
WarrenBelz Profile Picture

WarrenBelz 381 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 315 Super User 2026 Season 1

Last 30 days Overall leaderboard