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
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (3,774)