cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MarcBailey
Level 8

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
Sienna
Level 10

Re: Global Variable works on Desktop but not on Phone

Hi Marc

It looks like another user might have the same problem here

 

https://powerusers.microsoft.com/t5/General-Discussion/Avoid-multiple-user-update-SharePoint-list-da...

 

also note the last post for possible workaround

 

It didn't happen to me so far but I'm not using any connection to datasorces at the moment so that might be the reason. Have you tried to display those variables in labels on your AccountLog screen? Try to run it on your pc and phone and compare those values in  labels with selected gallery? If you get a mismatch then the problem will be with variables or perhaps with a iPhone PA player if it work on your pc and you should raise bug ticket or tag someone from PA group here and wait for them to fix it. Lets see what you get. I might have a temporary workaround to this issue if you don't want to wait for fix but first try this

MarcBailey
Level 8

Re: Global Variable works on Desktop but not on Phone

Hi Sienna,

 

I'm glad you had time to take a look at this.  Yes, I added a label that displayed the variable and it updates correctly on the Desktop and not on Phone.  I have done extensive testing by eliminating all other variables and deleting the majority of the other screens with the same results. It does appear to be a bug.  

 

I would greatly appreciate a workaround.

 

In addition, I am not sure where in the message reply to Tag someone from PA group or do I have to start a new message to do that.  Also, I didn't insert an image because I wasn't sure what is needed in the Source field on the Insert/Edit Image box - it use to show as insert photo and it worked. I could write a small book about my experience with the bug ticket process and the spin and evasiveness. But for now let's focus on the workaround and I will start the ticket process as well.

 

Thanks - Marc

MarcBailey
Level 8

Re: Global Variable works on Desktop but not on Phone

Sienna,

 

I see the tag feature.

MarcBailey
Level 8

Re: Global Variable works on Desktop but not on Phone

Sienna,

 

Here is another post from 10-20-17 that had a similar situation but doesn't show solution:

 

https://powerusers.microsoft.com/t5/I-Found-a-Bug/iPhone-Gallery-s-OnSelect-Event-not-Responding-Cor...

Sienna
Level 10

Re: Global Variable works on Desktop but not on Phone

Hi

That is interesting. Can you please make one more test? Can you temporary get rid of the navigate function in the gallery-onselect by keeping the variables and display them in the label on the same screen. Lets see if  on select function skips the variable and goes straight to navigate on the phone when navigate is there. If that is the issue then we can try a temporary solution for that until it will be fixed.

 

By tagging someone I meant to something like this. @MarcBailey I tagged you so you should get notification. Let me see if I can find a proper page for reporting bugs

MarcBailey
Level 8

Re: Global Variable works on Desktop but not on Phone

Sienna,

 

Yes - It is quite interesting as I have found with many things in PowerApps...  It will be a great platform but currently it is poorly documented related to issues, limitations, and restrictions - therefore developers waste a considerable amount of time doing trial and error to  figure out something that could have been reasonably documented.

 

I have included the label and eliminated the Naviagition function with the following results:

 

Desktop:  CurrentAcctID displays correctly on the AccountControl screen

IPhone:    CurrentAcctID displays incorrectly on the AccountControl screen it shows the CurrentAcctID from previously selected.

 

So, this eliminates the Navigation Function from the problem.  It appears to be with the OnSelect Set function on the Phone device.

 

I also did this same process using a ClearCollect in place of the Set function we the same results as above.

 

A workaround would be great.

 

Thanks so much for your help - Marc !!

 

 

Sienna
Level 10

Re: Global Variable works on Desktop but not on Phone

Hmm I was hoping that it will work by removing navigate. Lets do some workaround but first try to test them. I would suggest to make copy of your app

 

So lets say that there is some problem with variables on the phone

Try to use Collection

In your navigate button remove all variables and replace it with

ClearCollect(MySelection, ThisItem)

Test it by displaying the collection  "MySelection" in a gallery and if it will work then I'll tell you how to pull that data from that collection

 

So now lets say there is a problem with gallery trigering to set those variables

Try to use timer

1/ Add a timer item on your screen where you have the gallery (NOT into your gallery!!)

2/ Copy the code for VARIABLES ONLY in OnTimerStart property of the timer item from your gallery OnSelect. (obviously you will have to modify a code a bit by replacing all your ThisItem. ... to GalleryName.Selected. ....)

3/ In your OnTimerEnd add  UpdateContext({triger:false}); and your navigate code from your gallery

4/Now remove all coding from the gallery OnSelect and replace it with UpdateContext({triger:true})

5/Set timer Start property to "triger"

6/ Change duration to 300

7/ and finaly the timer visible property to false

 

Now test it with the varibles displayd in labels

Sienna
Level 10

Re: Global Variable works on Desktop but not on Phone

BTW I assume that the app is error or warning free with no exclamation marks anywhere.. right?

MarcBailey
Level 8

Re: Global Variable works on Desktop but not on Phone

Hi Sienna,

 

I have already tried the Collection with the same result.

 

I tried the timer about a week ago with the same result but will try it again with the App using minimal code and screens to see if that will help now.

 

There are no exclamations either yellow or blue in the entire Test App.

 

I will update you after running the timer again.

 

Thanks - Marc

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

Power Apps Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Users online (5,350)