cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Jbeau83
New Member

Adding a Date Range as a filterable item in a multi column filter via Sharepoint List

Greetings, 

 

I am relatively new to PowerApps from a use standpoint and a coding standpoint. I am trying to work from a Sharepoint list as my primary source, I have used various tricks I have found to mediate the delegation issues posed by that.

 

I have a multi column filter working already, however When trying to add a date range argument as well.. it doesn't seem to want to work. 

 

Jbeau83_0-1646600690943.png

 

The argument I was trying to include was:

 

Filter(

'MyDatasource',

'Date of Visit' >=SrtDate.selectedDate,

'Date of Visit' <=EndDate.selectedDate)

 

Any help for a newbie here would be most appreciated. 

 

Thank you,

 

JB

 

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @Jbeau83 ,

Firstly, can you please also post code in Text - I OCRd your image, so watch spelling in the below

With(
   {
      wList:
      SortByColumns(
         Filter(
            'MyDatasource',
            (
                MarketDropBox.Selected.Value = Blank() ||
                'Market:'.Value = MarketDropBox.Selected.Value
            ) &&
            ( 
               RegionDropBox.Selected.Value = Blank() ||
               Region.Value = RegionDropBox.Selected.Value
            ) &&
            'Date of Visit' >= SrtDate.SelectedDate &&
            'Date of Visit' <= EndDate.SelectedDate
         ),
         "field_5",
         Descending,
         "Title",
         Ascending
      )
   },
   If(
      CountRows(wList) < varDelegationlimit,
      Filter(
         wList,
         TextSearchBoxl.Text in Title ||
         TextSearchBoxl.Text in 'Contract Performed By:' ||
         TextSearchBoxl.Text in 'Dealer Name'
      ),
      wList
   )
)

 

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

View solution in original post

2 REPLIES 2
WarrenBelz
Super User
Super User

Hi @Jbeau83 ,

Firstly, can you please also post code in Text - I OCRd your image, so watch spelling in the below

With(
   {
      wList:
      SortByColumns(
         Filter(
            'MyDatasource',
            (
                MarketDropBox.Selected.Value = Blank() ||
                'Market:'.Value = MarketDropBox.Selected.Value
            ) &&
            ( 
               RegionDropBox.Selected.Value = Blank() ||
               Region.Value = RegionDropBox.Selected.Value
            ) &&
            'Date of Visit' >= SrtDate.SelectedDate &&
            'Date of Visit' <= EndDate.SelectedDate
         ),
         "field_5",
         Descending,
         "Title",
         Ascending
      )
   },
   If(
      CountRows(wList) < varDelegationlimit,
      Filter(
         wList,
         TextSearchBoxl.Text in Title ||
         TextSearchBoxl.Text in 'Contract Performed By:' ||
         TextSearchBoxl.Text in 'Dealer Name'
      ),
      wList
   )
)

 

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

@WarrenBelz , Thank you sir. I would have never considered using With argument. I'll have to research that going forward as a solution. 

 

Thank you so much again! 

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Users online (1,415)