web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Data Refresh Problem w...
Power Apps
Unanswered

Data Refresh Problem when Navigating between Screen

(0) ShareShare
ReportReport
Posted on by 230

When navigating using the OnSelect function (creating var to pass value) occassionally the data in the navigated to Screen does not update.  If I navigate back and then navigate to the Screen again then the data is correct.  I am not sure, but it is if sometimes the var does not post before the to Screen displays. 

 

Any help would be greatly appreciated.

 

Thanks, Marc

Categories:
  • Sienna Profile Picture
    1,532 on at
    Would you share more information how you do it? What is your code for pasing variable? A picture of it would be nice
  • MarcBailey Profile Picture
    230 on at

    Hi Sienna,

     

    Thanks for your reply - I have provided screen shots - please let me know if you need additional information.

     

    This is the OnSelect code for Account Control Screen:

    Set(CurrentAcctID,BrowseGallery1.Selected.ID);Set(NavigateAcctType,BrowseGallery1.Selected.AcctType.Value);Set(ProjectName,"");Set(ProjectHint,"No");Set(PhoneLaunch,BrowseGallery1.Selected.PhonePrimary);Set(EmailLaunch,BrowseGallery1.Selected.EmailPrimary); Navigate(AccountDetails, ScreenTransition.None)

     

    Data Refresh 2.JPGData Refresh 1.JPG

  • Sienna Profile Picture
    1,532 on at
    Thanks for that information. Let me ask you few more questions. What are you trying to do with all those variables in AccountDetails screen? Wouldn’t be easier to just pick all the values on AccountDetails screen from the selected gallery? Does all these variable has to be global? That means are you using those variables only on AccountDetails screen or in multiple screen?
  • Sienna Profile Picture
    1,532 on at
    Sorry for beeing so nosy. The reason Im asking is that I don’t think you actually need the variables. I think you’re just trying to display these data in AccountDetails screen. Am I right? Please fix me if im wrong
  • MarcBailey Profile Picture
    230 on at

    Hi again Sienna,

     

    Actually all of the variables are used on other screens.  The ProjectName and ProjectHint variables could be changed to local variables.  The Account Detail screen was probably not a good example because it uses Gallery1.selected and not a varialble. My Contact Screen uses the following code for Items:

     

    Filter(AcctContact, AcctID = Value(CurrentAcctID))

     

    Most of my Screens have a Gallery that is filtered.  I use the LaunchPhone and LaunchEmail var to provide a text value used with the OnSelect for buttons using the Launch function.

     

    Are you aware of any limitations, etc. that might cause the screen that is being navigated to - to not refresh with the selected data when it uses Gallery1.selected or a filtered gallery.

     

    Thanks for reviewing this - Marc...

  • Sienna Profile Picture
    1,532 on at
    Hi again.
    I’m not aware of any limitation. I only heard that the code sometimes doesn’t triger all codes before navigate but I never had that problem. The only reason I can see why you having the problem is that you got a lot of set function in one onselect property. Try to put all these variables into one record...

    Set(MyRecord,{CurrentAcctID:BrowseGallery1.Selected.ID, NavigateAcctType:BrowseGallery1.Selected.AcctType.Value,ProjectName:""ProjectHint:"No",PhoneLaunch:BrowseGallery1.Selected.PhonePrimary,EmailLaunch:BrowseGallery1.Selected.EmailPrimary}); Navigate(AccountDetails, ScreenTransition.None)

    Then pull the data from that record. Try if it will works.

    You can also pass the variable from within navigate function which will be only local.
    See if this will work for you first
  • MarcBailey Profile Picture
    230 on at

    Thanks Sienna,

     

    I will try that tonight and see if it solves my issue.  Thanks again for you help and I will update you are testing with the code you furnished.

     

    Marc

  • MarcBailey Profile Picture
    230 on at

    Sienna,

    After testing the code you provided and doing further analysis this is my update:

    What’s involved in this Scenario - 4 Screens:

    Account Control (Gallery - Variables are Set by clicking a Navigation Icon to Account Details screen)

    Account Details (DetailForms (DataCards) - Navigation DropDown List to Selected Value)

    Account Log (Gallery - Navigation Dropdown List to Selected Value)

    Contacts (Gallery - Navigation Dropdown List to Selected Value)

     

    On the Desktop running App:

    Both versions of the code works fine executing the following navigation:

    Account Control screen - Select > icon (OnSelect - Set Variable - Navigate) to Account Details sreen then DropDown to Account Log screen then DropDown to Contacst screen then Header to navigate back to Account Control screen and Select another Account and follow the same flow several more times.

     

    On the Mobile Device (Iphone) running App:

    Both versions of the code create the same problem when executing the following navigation:

    Account Control screen - Select > icon (OnSelect - Set Variable - Navigate) to Account Details sreen then DropDown to Account Log screen (Displays data from previous selected Account not current) then DropDown to Contacts screen (Displays data from previous selected Account not current) screen then Header to navigate back to Account Control screen and Select another Account and follow the same flow several more times (Displays data from previous selected Account not current) everytime. The Account Details screen works correctly on Mobile Device, it uses Forms(datacards). The problem occurs on the Account Log screen and Contacts screen which use Galleries.

    Note: If the same Account is selected from the Account Control screen twice in a row then it will give the correct data in the Account Log and Contact screen (which is consistent with the above explanation).

     

    Question ?: Does it appear the performs differently on the Mobile Device because of processing speed versus the Desktop processing speed.

     

    Please let me know your thoughts and possible solutions.

    Thanks, Marc..

  • Sienna Profile Picture
    1,532 on at
    I wouldn’t bet on speed.... So if the problem is only on those 2 screens what usees galleries... how do you filter datasources in those galeries. Can you send a picture of the code what you use in item property and data property of those galleries
  • MarcBailey Profile Picture
    230 on at

    Hi Sienna,

     

    It is strange that it works fine when running the exact same App on my Desktop but when I run it on my Mobile Device the problem occurs.

     

    The Data = AcctLog (Sharepoint List)

     

    Thanks again for reviewing this, Marc

     

    Data Refresh 3.JPG

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 221 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 188 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 120

Last 30 days Overall leaderboard