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 / Update Context for the...
Power Apps
Unanswered

Update Context for the visibility of an item doesn't work on start but only when change page

(0) ShareShare
ReportReport
Posted on by

Hey guys,

 

In my app at the OnStart I've set a ClearCollect function and at OnVisible of the "Home" page there's a formula to set the visibility of a gallery based on a filtered countrows.

 

OnStart: ClearCollect(bookinglist,'DB-Booking')

OnVisible-Home: If(CountRows(Filter(bookinglist,Mail=Label6.Text,Day=Label6_1.text))=0,UpdateContext({visible:false}),UpdateContext({visible:true})

 

Home formulas

Visible-Gallery: visible

Label6= Text(Today(),"dd/mm/yyyy")

Label6_1=User().Email

 

When I start the app the gallery doens't load but when i move to another page then come back it appers.

 

Any tips?

Many thanks

Categories:
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @Sesese 

     Your formula for OnVisible home is missing a ")" at the end for the If() function.

     If(
     IsEmplty(
     Filter(
     bookinglist, Mail=Label6.Text, Day=Label6_1.text
     )
     ), UpdateContext({visible:false}), UpdateContext({visible:true})
     )
    

     

  • Sesese Profile Picture
    on at

    Hi @Drrickryp ,

     

    thank you for your answer, I've changed the formula according to your suggestions but it still doesn't work when the page loads but only when I come back to the home page after navigating to another one

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

    Hi @Sesese ,
    You have a refreshing /calculation order issue there - forget about the labels and do this (also visible is not a good name for a Variable)

    UpdateContext(
     {
     visible:
     CountRows(
     Filter(
     bookinglist,
     Mail = User().Email && 
     Day = Text(Today(),"dd/mm/yyyy")
     )
     ) > 0
     }
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

     

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 July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 395 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 260 Most Valuable Professional

Last 30 days Overall leaderboard