cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Stefano__
Level: Powered On

Date filter not working

Hi all,

 

I am creating one powerapp which is showing on a gallery some records from a SharePoint list.

This list can be filtered accordingly to two datetime fields and the search text by a search field.

Not working

Filter(SharePointListName,
StartsWith(NameFiled,TextSearchBox1.Text),
Now()>DataField1,
Now()<=DataField2
)

 

Working

Filter(SharePointListName,
        StartsWith(NameField,TextSearchBox1.Text),
        Now()<=DataField2
)

 

Not working again

It seems it can work with maximum 2 constrains so I did try by putting 2 or also all condition in one AND statement:

 

Filter(SharePointListName,
        StartsWith(NameField,TextSearchBox1.Text),
            And(
                Now()>=DataField1,
                Now()<=DataField2
            )
)

 

Any idea?

 

Thank you in advance for help,

Stefano

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Date filter not working

Hi @Stefano__ 

 

Can you give me some example dates that are not working with this - there's definitely not a constraint limited to two within Filter, as I have some with at least 15 or more constraints. You should try also display your dates with labels temporarily for debugging purposes.

 

Filter(
SharePointListName
,
StartsWith(NameFiled,TextSearchBox1.Text)
,
Now()>DataField1
&&
Now()<=DataField2
)

 

The Test I did with this worked as expected - I have attached the .msapp for you to have a look at for reference,

 

Cheers,

ManCat




Don't forget to 'Mark as Solution' if a post answered your question and always 'Thumbs Up' the posts you like or helped you!

View solution in original post

3 REPLIES 3
Super User
Super User

Re: Date filter not working

Hi @Stefano__ 

 

Can you give me some example dates that are not working with this - there's definitely not a constraint limited to two within Filter, as I have some with at least 15 or more constraints. You should try also display your dates with labels temporarily for debugging purposes.

 

Filter(
SharePointListName
,
StartsWith(NameFiled,TextSearchBox1.Text)
,
Now()>DataField1
&&
Now()<=DataField2
)

 

The Test I did with this worked as expected - I have attached the .msapp for you to have a look at for reference,

 

Cheers,

ManCat




Don't forget to 'Mark as Solution' if a post answered your question and always 'Thumbs Up' the posts you like or helped you!

View solution in original post

Stefano__
Level: Powered On

Re: Date filter not working

Thank you so much @iAm_ManCat .

I did swap And(DateField1,DateField2) with DateField1 && DateField2 and it worked.

 

Best regards

Super User
Super User

Re: Date filter not working

Glad to help @Stefano__  - I know first-hand how ambiguous some of the filtering and code nuances can be 🙂




Don't forget to 'Mark as Solution' if a post answered your question and always 'Thumbs Up' the posts you like or helped you!

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 339 members 6,052 guests
Recent signins:
Please welcome our newest community members: