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 / Issue in Gallery Item ...
Power Apps
Unanswered

Issue in Gallery Item property using variable passed from another screen

(0) ShareShare
ReportReport
Posted on by 2

Hi,

I am building a basic task management application where the Home screen (Dashboard Screen) has multiple buttons which on clicking takes the user to another screen (Landing Screen) having a Gallery to display the rows of data. Data is filtered on the basis of "Assigned To", "Created By"....etc.

Home ScreenHome Screen

 

 

 

 

 

 

 

 

 

The Variables have been declared in the OnVisible Property on the "Home Screen"

 

 

Set(asgto,Blank()); //AssignedTo
Set(asgby,Blank()); //AssignedBy
Set(ctdby,Blank()); //CreatedBy

 

 

The OnSelect property in the "Assigned To" button fetches the current login in user`s email and updates the variable in the "Home Screen". 

 

 

Navigate(
 'Landing Screen',
 ScreenTransition.Cover,
 {asgto: User().Email}
)

 

 

Landing ScreenLanding Screen

The Items Property in the Gallery control on the "Landing Screen" displays the current logged in user`s "Assigned To" Task. I am using a filter as follows:-

 

 

Filter(
 ATR,
 'Created By'.Email = ctdby || IsBlank(ctdby),
 'Assigned to'.Email = asgto || IsBlank(asgto),
 'Assigned By'.Email = asgby || IsBlank(asgby)
 )

 

 

The OnHidden property in the "Landing Screen" resets the variables to blank before the user gets back to the "Home Screen"

 

 

UpdateContext({asgby:Blank()});
UpdateContext({asgto:Blank()});
UpdateContext({ctdby:Blank()});

 

 

The problem is that the Gallery doesn`t seem to fetch the variables and remains blank. Although the variables have been passed on to the "Landing Screen" as I have checked by putting them on a label control. I can understand that somewhere I am getting the order of execution wrong. How do I fix it?

Thanks for any advice.

@v-xiaochen-msft  - It`s very similar to a post that you have replied here.

Categories:
I have the same question (0)
  • timl Profile Picture
    37,262 Super User 2026 Season 1 on at

    Hi @Devin9 

    With the formula that you've posted, both the global and context variables are named identically - asgto in the example beneath. This ambiguity is the most likely cause of the problem.

     

    Set(asgto,Blank()); //AssignedTo
    
    Navigate(
     'Landing Screen',
     ScreenTransition.Cover,
     {asgto: User().Email}
    )
    
    

     

    I would suggest that you give the context variables another name (for example, locAsgto). You would then refer to the locAsgto variable in your call to Filter.

     

    Navigate(
     'Landing Screen',
     ScreenTransition.Cover,
     {locAsgto: User().Email}
    )
    
    

     

     

  • Devin9 Profile Picture
    2 on at

    I have tried but it is not working. I am following the steps as in the order below:-

    Screen 1 : Declare a variable > Update the value to the Variable > Pass the variable to Screen 2

    Screen 2 : Display the data based on the variable > Reset it back Blank

  • WarrenBelz Profile Picture
    156,100 Most Valuable Professional on at

    @Devin9 ,
    As @timl has indicated, you have two variables with the same name. It may actually be easier to simply use the global item

    Set(asgto,User().Email);
    Navigate(
     'Landing Screen',
     ScreenTransition.Cover
    )

    just make sure you do not refer to asgto in any other navigation or (on the target screen) an UpdateContext statement as Context Variables take precedent over Global items of the same name on the relevant screen. 

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

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 335 Most Valuable Professional

#2
11manish Profile Picture

11manish 165

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 96 Super User 2026 Season 1

Last 30 days Overall leaderboard