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

Update context variable of another screen

(0) ShareShare
ReportReport
Posted on by

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,228 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
    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,387 Super User 2025 Season 2 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
    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
    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

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 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard