cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jhoekstraccsd
Level: Powered On

Changing Status of Selected Gallery Item doesn't change Update Context variable?

Hi all, 

 

I hope I'm explaining this right:   I have an Gallery of records that passes one to an EditRecordScreen where a user can edit these items, after which the app uses a Patch command to edit the record in the database (SQL Data Source) then navigates back to the EditRecordScreen. 

I'm thave a label show the status of that item ("NEW", "APPROVED","REJECTED") -- whenever the data source is patched and the user is sent back to this screen, this status label never gets updated. 


The status label is set like this:  UpdateContext({mySubmissionStatusVar: ListingAdminGallery.Selected.Status});
where the status variable that displays as the label's value is sourced from a selection gallery on a separate screen. 

But, when I navigate to the page after the Patch command, even though the database record has been updated with an "APPROVED" status, the label still says "NEW".   
Example seqeuence:   Patch(...,...);Set(mySubmissionStatusVar,"APPROVED");Navigate(EditRecordScreen,None)

I'm having trouble wrapping my head around what I should be updating in addition to the Patch command so that the status reflects the correct record status instead of what the Gallery's selected record's previous status was.  

 

1 ACCEPTED SOLUTION

Accepted Solutions
jhoekstraccsd
Level: Powered On

Re: Changing Status of Selected Gallery Item doesn't change Update Context variable?

Thanks ... that actually.. worked?  I don't know why I didn't think of trying that.  I'm not sure why the timing of the call to the Gallery record works differently outside the UpdateContext, but for this one label that small change is exactly the results I wanted.  Thanks!

3 REPLIES 3
h-nagao
Level 10

Re: Changing Status of Selected Gallery Item doesn't change Update Context variable?

Hi,
How about when you set Text property of label (showing status) to just ListingAdminGallery.Selected.Status ??
jhoekstraccsd
Level: Powered On

Re: Changing Status of Selected Gallery Item doesn't change Update Context variable?

Thanks ... that actually.. worked?  I don't know why I didn't think of trying that.  I'm not sure why the timing of the call to the Gallery record works differently outside the UpdateContext, but for this one label that small change is exactly the results I wanted.  Thanks!

h-nagao
Level 10

Re: Changing Status of Selected Gallery Item doesn't change Update Context variable?

Hi,
To answer your question, could you give a bit detail for...
- When/where you update context variable and its formula
- formula previously set to label showing “NEW”, “APPROVED”

Thanks,

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

Users Online
Currently online: 248 members 5,189 guests
Please welcome our newest community members: