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

Community site session details

Session Id : VoOUh3Fpdh2FBvxWw0U2wN
Power Apps - GCC, GCCH, DoD - Federal App Maker...
Answered

SharePoint Delegation and Filters with DateTime Columns

Like (0) ShareShare
ReportReport
Posted on 22 May 2025 19:14:22 by 8
Hello Y'all,
 
Newbie here. I'm trying to use a formula to filter by the Date/Time column I have called 'Status'. I got it to work but not without delegation errors of course. Is there a way to make this formula without StartsWith? At least that is what I think is causing the error. Formula in Items for the Gallery;
 
SortByColumns(Filter([@'Paid Time Off (PTO)'], StartsWith(Start,TextSearchBox1.Text)), "Start", If(SortDescending1, SortOrder.Descending, SortOrder.Ascending))
 
Also, would it be possible to add on a filter using the datetime columns with datepicker to filter a range of items between those dates? I've searched YouTube and the web with no luck on this. At least not without Delegation or Boolean errors so nothing to work off of there I can provide besides the date picker names:
 
dpStartDate
dpEndDate
 
Any enlightenment would be greatly appreciated!
Categories:
I have the same question (0)
  • CU22051816-0 Profile Picture
    8 on 25 May 2025 at 03:35:52
    SharePoint Delegation and Filters with DateTime Columns
     
    That is exactly how I was wanting to do it, search by a certain date format. That did it! I just had to "reconnect" the data source for the items to show when selected for some reason.
     
    Thanks for your help!!
  • Verified answer
    WarrenBelz Profile Picture
    150,345 Most Valuable Professional on 23 May 2025 at 22:52:27
    SharePoint Delegation and Filters with DateTime Columns
    Sorry, still a bit lost here - if Start is a Date/Time column how exactly are you wanting to search on it other than between the two date pickers ? Are you wanting to search on another field or if you wanted to search on a particular date format
    With(
       {
          _Data:
          Filter(
             [@'Paid Time Off (PTO)'], 
             DateFieldName >= StartDatePicker.SelectedDate &&
             DateFieldName <= EndDatePicker.SelectedDate
          )
       },
       SortByColumns(
          Search(
             AddColumns(
                _Data,
                DateText,
                Text(Start, "ddd d mmm yyyy")
             ),			
             TextSearchBox1.Text,
             DateText
          ),
          "Start",
          If(
             SortDescending1, 
             SortOrder.Descending, 
             SortOrder.Ascending
          )
       )
    )
     
    Please click Does this answer your question 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 a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps    LinkedIn   
  • CU22051816-0 Profile Picture
    8 on 23 May 2025 at 21:52:58
    SharePoint Delegation and Filters with DateTime Columns
     
    It is a Date and Time Column in SharePoint. End state would be for it to filter by the current user (Office365 Users Connected) with a checkbox to where they can see all items. If they know the start date of their request they could search by the date or search between a range. I dont know if that is the best way but that was the vision.
     
     
     
     
     
  • WarrenBelz Profile Picture
    150,345 Most Valuable Professional on 23 May 2025 at 21:13:30
    SharePoint Delegation and Filters with DateTime Columns
    I was expecting it to be of Text type as well as you used StartsWith() in your post. What type is it and how exactly are you expecting it to filter ?
  • CU22051816-0 Profile Picture
    8 on 23 May 2025 at 14:21:10
    SharePoint Delegation and Filters with DateTime Columns
    Good morning @WarrenBelz
     
    Hope your coffee is strong this morning and problems are few!
     
    I am getting an invalid argument error at search. It is excepting the column "Start" to be a text type.
     
    With(
       {
          _Data:
          Filter(
             [@'Paid Time Off (PTO)'],
             Start >= dpStartDate.SelectedDate &&
             End <= dpEndDate.SelectedDate
          )
       },
       SortByColumns(
          Search(
             _Data,
             TextSearchBox1.Text,
             Start
          ),
          "Start",
          If(
             SortDescending1,
             SortOrder.Descending,
             SortOrder.Ascending
          )
       )
    )
  • WarrenBelz Profile Picture
    150,345 Most Valuable Professional on 22 May 2025 at 21:19:53
    SharePoint Delegation and Filters with DateTime Columns
    Something like this should do it - note that the top filter (between the dates) needs to return record numbers (the list can be of any size) less than your Data Row Limit for full results to be returned.
    With(
       {
          _Data:
          Filter(
             [@'Paid Time Off (PTO)'], 
             DateFieldName >= StartDatePicker.SelectedDate &&
             DateFieldName <= EndDatePicker.SelectedDate
          )
       },
       SortByColumns(
          Search(
             _Data, 
             TextSearchBox1.Text,
             Start
          ),
          "Start",
          If(
             SortDescending1, 
             SortOrder.Descending, 
             SortOrder.Ascending
          )
       )
    )
     
    Please click Does this answer your question 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 a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps    LinkedIn   
    Buy me a coffee

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

MS.Ragavendar – Community Spotlight

We are honored to recognize Ragavendar Swaminatha Subramanian as our September…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 982 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 396 Super User 2025 Season 2

#3
Power Apps 1919 Profile Picture

Power Apps 1919 356

Last 30 days Overall leaderboard

Featured topics

Loading started