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

Filtering Issues with Date, as well as by input box

Hi there!

 

I currently have a Gallery connected to a collection based upon the information stored within a SQL database. It has sentiment analysis attached and currently filters via a text input box. Everything works perfectly.

 

However what I'd like to implement, is that the gallery only shows collection items which are no more than two days old - there are a LOT of records and it's slowing down the experience.

 

The existing code which works like a dream is as follows:

 

 

SortByColumns(
    Filter(
        MyCollection,
        StartsWith(
            CompName,
            TextInput1.Text 
        )
    ),
    "SourceDate",
    Descending,
    "sentiment",
    Descending
))

 

 

 

 

I've also tried:

 

 

 

SortByColumns(
    Filter(
        MyCollection,
        StartsWith(
            CompName,
            TextInput1.Text 
        ),
        SourceDate >= Today(),  
       SourceDate< DateAdd(Today(), 2, Days
    ),
    "SourceDate",
    Descending,
    "sentiment",
    Descending
))

 

 

 

And it's erroring out.

 

Can anybody advise how I could go about resolving this?

 

Thank you in advance.

 

W

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @wilfordm81 ,

Brackets

SortByColumns(
   Filter(
      MyCollection,
      StartsWith(
         CompName,
         TextInput1.Text 
      ) &&
      SourceDate >= Today() &&   
      SourceDate < DateAdd(Today(),2,Days)
    ),
    "SourceDate",
    Descending,
    "sentiment",
    Descending
)

 

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

in the wrong place

View solution in original post

2 REPLIES 2
WarrenBelz
Super User
Super User

Hi @wilfordm81 ,

Brackets

SortByColumns(
   Filter(
      MyCollection,
      StartsWith(
         CompName,
         TextInput1.Text 
      ) &&
      SourceDate >= Today() &&   
      SourceDate < DateAdd(Today(),2,Days)
    ),
    "SourceDate",
    Descending,
    "sentiment",
    Descending
)

 

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

in the wrong place

wilfordm81
Helper II
Helper II

Hi @WarrenBelz!

 

It's always the brackets I seem to forget about. Thanks a mil!

 

W

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.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (1,735)