cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper III
Helper III

filter gallery using string date ranges

Hi all,

 

I'm trying to filter a gallery from start date to end date (date pickers). I don't want to run into the delegation issue so i've created a 'strCreated' single line column to use instead. how can i filter the gallery using this field? This is what i have so far but nothing comes up: 

 

Filter(colItems, strCreatedDate >= dpStartDate.SelectedDate && strCreatedDate <= dpEndDate.SelectedDate)

 

Any clues what I could be missing? 

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Super User III
Super User III

@_sourcecod3_ 

Usually PowerApps will cast the value for you, but not always, so give this a try instead:

Filter(colItems, 
    (Value(strCreatedDate) >= Value(Text(dpStartDate.SelectedDate, "yyyymmdd"))) && 
    (Value(strCreatedDate) <= Value(Text(dpEndDate.SelectedDate, "yyyymmdd")))
)
_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

4 REPLIES 4
Super User III
Super User III

@_sourcecod3_ 

What is the format of your text date you are storing?  It must be stored in the yyyymmdd format.

 

Then your formula will be:

Filter(colItems, 
    strCreatedDate >= Text(dpStartDate.SelectedDate, "yyyymmdd") && 
    strCreatedDate <= Text(dpEndDate.SelectedDate, "yyyymmdd")
)

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

Hi @RandyHayes i tried your suggestion but it looks like it's looking for a number value. This is the error i get: 

 

_sourcecod3__0-1607718182635.png

 

When i change the Text to Value instead there are no errors but nothing it being pulled in the gallery.

Super User III
Super User III

@_sourcecod3_ 

Usually PowerApps will cast the value for you, but not always, so give this a try instead:

Filter(colItems, 
    (Value(strCreatedDate) >= Value(Text(dpStartDate.SelectedDate, "yyyymmdd"))) && 
    (Value(strCreatedDate) <= Value(Text(dpEndDate.SelectedDate, "yyyymmdd")))
)
_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

@RandyHayes This is perfect!! thank yo so much

 

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Top Solution Authors
Top Kudoed Authors
Users online (106,968)