cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
KurtSchron
Advocate I
Advocate I

Update Context Variable Object.Object Property

I have a Context Variable that is an Object with many properties. 

 

I have some text inputs that perform a Patch function OnChange of the input. 

 

What I would like to do is then update the Context Variable Object so if the user navigates to other pages that still use that context variable it is accurate. 

 

I've tried, 
UpdateContext( { GallerySelectedProject: Patch( GallerySelectedProject, {percent_to_close: Value(pctToCloseInput.Text) } ) } );
UpdateContext({GallerySelectedProject: {percent_to_close: Value(pctToCloseInput.Text) } });

Neither seem to work and start to throw a lot of errors as it appears that it is overwriting the whole context variable but I just want to update this one property. I looked at this page and either of these seem like they should work but they are not. https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-updatecontext

 

Any help? 

2 REPLIES 2
Jeff_Thorpe
Super User
Super User

What does the object in the content variable look like?



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

I set it when a user clicks on a gallery using the navigate, 

Navigate(ProjectDetails,ScreenTransition.Cover,{GallerySelectedProject: ThisItem, editFormStatus: false, varShowEstimateDetails: false})

 

It has many properties on that next page like, 

GallerySelectedProject.engineer = "Joe Smith"

GallerySelectedProject.opportunity = 10000

...

So an object like GallerySelectedProject{engineer: "Joe Smith", opportunity: 10000, .... }

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (1,177)