cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Resolver II
Resolver II

Global Variable works on Desktop but not on Phone

This post is related to a previous post that I made on on 1-16-18.  The new post was made after extensive testing and will bring more clarity to issue than the original post:

https://powerusers.microsoft.com/t5/General-Discussion/Data-Refresh-Problem-when-Navigating-between-...

 

The App runs with no problems on my Desktop but on my Mobile Device (IPhone 7) the Global Variable does not update to the Selected Account fast enough.

 

Problem: On the Mobile Device when selecting the Set and Navigate control for an account from the AccountControl screen - it navigates and populates the data in the AccountLog screen prior to Global Variable being posted.  Therefore, it displays the data from the previous selected account.  If I naviagate back to the AccountControl screen and select another account it displays the previous selected account again which means the Global Variable is getting updated at some point after the AccountLog screen is loaded. 

 

What's involved in this Scenario - 2 Screens and Code - Uses SharePoint Lists as Datasources:

 

AccountControl screen - OnSelect:

Set(CurrentAcctID,BrowseGallery1.Selected.ID);Navigate(AccountLog, ScreenTransition.None)

 

AccountLog screen - Gallery3 - Items:

SortByColumns(Filter(AcctLog,AcctID = Text(CurrentAcctID)),"DateEntered",Ascending)

 

I have done numerous test including a Collection with the exact same results.

 

I would appreciate any insight, solution, or workarounds on this matter.

 

Thanks - Marc

22 REPLIES 22
Highlighted


@Anorakman wrote:

 

Anyone got any thoughts on how to work around this problem until it is fixed?  If it is fixed?


 

Hi Anorakman,

Thank you for providing steps for replication. That helped a lot and gave me a good sense of how and why you were encountering this issue. @KroonOfficeSol, I appreciate that you stepped up and offered help.

 

I was able to replicate the issue on iOS and I have two comments:

  1. This can be solved with best practices. When working within a Gallery, I set the global variable to ThisItem instead of Gallery.Selected. ThisItem is designed for citing child content whereas Gallery.Selected is for referencing the gallery from controls outside the gallery. 
  2. It appears like the action is being activated before the row in the gallery is considered "selected." This explains how the variable seems to be behind by one step. It does not register the selection until after the actions are performed.

Let me know if that helps.

 

Mr. Dang

 

_______________

Microsoft Employee
@8bitclassroom
Highlighted

He Mr Dang,

 

This is indead a nice improvement and a better way to fill the Global variable, nice. But wouldn't still the Gallery be filtered on screen entry or is this update preformed before the screen to become visible? How does PowerApps handles this in the background?

 

Paul

Highlighted

Many thanks.  Using the ThisItem reference works.  Clearly the Gallery.Selected value is updated after the action to Set the global variable is completed.

 

Only question is why this behaviour is inconsistent between iOS and pc browser.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (4,431)