Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Issue with filtering gallery by date range

(0) ShareShare
ReportReport
Posted on by 9

I have a gallery that I'm filtering by a few different queries and I see a weird issue every once in and while. 

 

It's a gallery within a gallery and when I first go to the screen the filter doesn't work properly but if I leave the screen and come back it then works properly. The first gallery acts like an accordion where the headers are the status, once clicked that section opens with the items with that status within the open section. 

 

First gallery 'Items' property:

 

Choices(Tasks.Status)

 

 

Inner gallery 'Items' property:

 

SortByColumns(
 Filter(
 Tasks,
 Status.Value = ThisItem.Value && ('Due Date' >= varStartDate && 'Due Date' <= varEndDate) && 'Created By'.Email = varUser.Email,
 StartsWith(
 Title,
 Search_5.Text
 ) || StartsWith(
 RelatedRequestTitle,
 Search_5.Text
 )
 ),
 "DueDate"
)

 

 

When I first go to the screen the item count is 0. If I go to a different screen and back to the first screen the items then show

2023-10-12_10-55-40.jpg2023-10-12_10-56-48.jpg

  • Verified answer
    t145h1b1 Profile Picture
    t145h1b1 9 on at
    Re: Issue with filtering gallery by date range

    Ugh, brain fart 😞 I was setting the date variables on a different screen's OnVisible prop. I've moved it to the app OnStart 

  • Verified answer
    BCBuizer Profile Picture
    BCBuizer 21,809 on at
    Re: Issue with filtering gallery by date range

    Hi @t145h1b1 ,

     

    When navigating between screen, does the value of varStartDate and varEndDate change? 

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,526

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,907

Leaderboard