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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Power Apps Date Picker...
Power Apps
Answered

Power Apps Date Picker Syntax

(0) ShareShare
ReportReport
Posted on by 25

 

 

 

SortByColumns(Filter('Bonus DB','File Number'= SearchBox.Text, DateValue, Date >= ddTimeSelection.Selected.StartDate && Date <= ddTimeSelection.Selected.EndDate))

 

 

 


Look I know Its wrong, but the idea is this.... We want the data to be sorted from the Bonus DB to allow filtering from new to old based on the users choice. We also want to search between the two Date values. I am not familiar with the syntax to integrate both of these options.

It does work fine without the date code to search based on the File Number so I know the issue is with the syntax. Issue is its fairly specific and no one has gone over it being used in this way.

(Original working code)

 

 

 

SortByColumns(Filter('Bonus DB','File Number'= SearchBox.Text),"PayDate", If(SortDescending1, Descending,Ascending))

 

 

 




DMillner_0-1637251016188.png
Any help is appreciated. 

 

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,084 Most Valuable Professional on at

    Hi @DMillner ,

    Maybe something like this - I am not sure where the DateValue reference applies

    SortByColumns(
     Filter(
     'Bonus DB',
     (
     Len(SearchBox.Text) = 0 ||
     'File Number'= SearchBox.Text
     ) &&
     Date >= ddTimeSelection.Selected.StartDate && 
     Date <= ddTimeSelection.Selected.EndDate
     ),
     "PayDate",
     If(
     SortDescending1, 
     Descending,
     Ascending
     )
    )

     

    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

  • DMillner Profile Picture
    25 on at

    The date that Im trying to get is from the Pay Date column as shown below. I tried the code that was sent, but it does not use the values set. I may need to reference the dates in the column in DateValue specified, but Im not sure if I would put an array in there or how that would go to go though multiples dates.

    DMillner_0-1637335353975.png

     

  • Verified answer
    WarrenBelz Profile Picture
    153,084 Most Valuable Professional on at

    @DMillner ,

    I simply used the field values you posted - you probably need something like

    SortByColumns(
     Filter(
     'Bonus DB',
     (
     Len(SearchBox.Text) = 0 ||
     StartsWith(
     'File Number',
     SearchBox.Text
     )
     ) &&
     'Pay Date' >= ddTimeSelection.Selected.StartDate && 
     'Pay Date' <= ddTimeSelection.Selected.EndDate
     ),
     "PayDate",
     If(
     SortDescending1, 
     Descending,
     Ascending
     )
    )

     

    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

  • DMillner Profile Picture
    25 on at

    Hey, I think thats the right direction, but I moved a few things around and let the autofill assist a bit. I then reduced it down to just the filter section to see if I could figure it out. Still no luck, but here is as close as I got. Still no values showing with the data options.

    DMillner_0-1637603085973.png

     

  • WarrenBelz Profile Picture
    153,084 Most Valuable Professional on at

    @DMillner ,

    There is something else wrong here - the code

    Filter(
     ’Bonus DB’,
     'Pay Date' >= STARTDate.SelectedDate && 
     'Pay Date' <= ENDDate.SelectedDate
    )
    

    is correct assuming 'Pay Date' is a Date field and should not produce a Delegation warning unless you are using Excel (what is your data source and how may records are in there?) .

     

    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

  • DMillner Profile Picture
    25 on at

    Its coming from a Bonus DB list on sharepoint.

  • WarrenBelz Profile Picture
    153,084 Most Valuable Professional on at

    @DMillner ,

    I just tested the exact syntax on a large (10,000 record) SharePoint list and got the correct records (as I expected). Are you sure this is a Date field and records actually exist for the dates you are searching. Also how many records are in the list?

  • DMillner Profile Picture
    25 on at

    Im not doubting the code, I just dont know why it wouldnt be working on my end. I tried it with 'Pay Date_Column1' as well. Below is a copy of the list with the sections under Pay Date underlined. This is what I was using and the dates are in the range I was testing. This is not a large list by any means and only has about 30 entries.

    Im just not seeing what Im missing from this. Do I need to save the averages to a variable to reference the greater than or equal to? I confirmed the dates are in the same order (MM/DD/YYYY). I also tried && as well as using a , to see if it would work better with no change.

    Can you post what you did for the testing? Maybe it will help me see what Im doing wrong here.

    DMillner_1-1637681735362.png

     



    DMillner_0-1637680691414.png

     

  • DMillner Profile Picture
    25 on at

    All, 

    I see the issue. I had to set the data type as a Date in the list itself to get PowerApps to read it as a date. Apparently that was a must that I missed.

  • WarrenBelz Profile Picture
    153,084 Most Valuable Professional on at

    Hi @DMillner ,

    The exact question I asked  -  Are you sure this is a Date field 

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard