cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dennisb88
Resolver III
Resolver III

Filter Gallery on date time with today in dataverse

Hi all,

 

I'm struggling with a filter inside of a gallery:

 

I want to filter all tasks they are matched with today.

In dataverse I've a date/time column: named Startdate. 

 

FYI: It is a gallery inside an other gallery, that's because I'm also filtering on a textfield.

 

My formula: 

Filter(Taaks,Medewerker.Weergavenaam = Title8.Text,Startdatum = Today())

 

I've also tried to do it as follow:

Filter(Taaks,Medewerker.Weergavenaam = Title8.Text,DateValue(Text(Startdatum,DateTimeFormat.ShortDateTime24)) = Today())

This one give some results, but I've also an error:

dennisb88_0-1629895644040.png

And it's give me a delegation warning.

 

Hoping someone can help me with this.

2 ACCEPTED SOLUTIONS

Accepted Solutions

Hi @dennisb88 ,

The problem you have is that you are trying to compare a date with a date and time field (which will never equal and turning it into a date with DateValue and text results in Delegation issues) - try this

With(
   {
      wDay1:Today(),
      wDay2:DateAdd(Today(),1,Days)
   }
   Filter(
      Taaks,
      (
         IsBlank(Title8.Text) ||
         Medewerker.Weergavenaam = Title8.Text
      ) &&
      Startdatum > wDay1 && Startdatum < wDay2
   )
)

 

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.

View solution in original post

Hi @WarrenBelz ,

 

Thank you for your reply.

I've changed my the column type to date only. For now it's OK to use that type of data and I've no delegation issue anymore.

 

Thanks again and have a nice day!

View solution in original post

9 REPLIES 9
PG_WorXz10
Resident Rockstar
Resident Rockstar

Hi @dennisb88 ,

 

Would you please check if below code works ? 

Filter(Taaks,Medewerker.Weergavenaam = Title8.Text,Text(Startdatum,ShortDate) = Text(Today(),ShortDate))

 

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.

If this post was helpful or you need more help please consider giving Thumbs Up and Tag me in your reply I'll be happy to help. If this post helped you solve your issue please click Accept as solution and provide Thumbs Up. This will help others find it more readily.

Hi @PG_WorXz10 ,

 

Thank you for your reply.

Unfortunately it isn't work. It gives me the same error.

dennisb88
Resolver III
Resolver III

Hi @PG_WorXz10 ,

 

I'm try something. And I think I've two different issues:

1) Delegation issue:

Filter(Taaks,DateValue(Text(Startdatum,DateTimeFormat.ShortDateTime24)) = Today())

Works fine. But It's give me a delegation warning. And I don't want that warning because there are large datasets.

2) The first part of my filter formula, is filtering a lookup field: (medewerker is a lookup field to another table). It's working as expected. But it's showing an "error":

Filter(Taaks,Medewerker.Weergavenaam = Title8.Text)

This error is related to this part of the formula:

dennisb88_0-1629897352524.png

 

I don't know why the "Filter(Taaks,Medewerker.Weergavenaam = Title8.Text)" is working OK (but gives the error) and when I add the other filter "Filter(Taaks,DateValue(Text(Startdatum,DateTimeFormat.ShortDateTime24)) = Today())" it's not working.

 

Hopefully someone know how to handle this.

Regards,
Dennis

 

 

 

Hi @dennisb88 ,

 

Is the Startdatum is of text type ?

If you convert today() in a variable like Set(varTodayDate,Text(Today(),"dd/mm/yy")) on start and check directly 

Startdatum = varTodayDate will it work in your case ?

If this post was helpful or you need more help please consider giving Thumbs Up and Tag me in your reply I'll be happy to help. If this post helped you solve your issue please click Accept as solution and provide Thumbs Up. This will help others find it more readily.

Hi @PG_WorXz10 ,

 

Thanks again for your reply.

Startdatum is not a text type, it's a date/time type.

 

I've tried to get it, but it's give me the same delegation warning.

WarrenBelz
Super User
Super User

Hi @dennisb88 ,

Try this

Filter(
   Taaks,
   (
      IsBlank(Title8.Text) ||
      Medewerker.Weergavenaam = Title8.Text
   ) &&
   Startdatum = Today()
)

 

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.

Hi @WarrenBelz ,

 

Thank you for your reply.

I'm think I'm really close to a solution.

 

At this moment it's not working because I've not a correct match with the "Startdatum" field:

The startdatum is a date time property that has the value for example : 8/30/2021 8:00 AM

The Today value has as value: 8/30/2021

 

When I use this expression I get the delegation warning: 

Filter(
   Taaks,
   (
      IsBlank(Title8.Text) ||
      Medewerker.Weergavenaam = Title8.Text
   ) &&
   DateValue(Text(Startdatum,"mm/dd/yyyy")) = Today()
)

Without the date formatting I haven't the warning, but the filter won't work.

 

Any suggestion / Idea?

Hi @dennisb88 ,

The problem you have is that you are trying to compare a date with a date and time field (which will never equal and turning it into a date with DateValue and text results in Delegation issues) - try this

With(
   {
      wDay1:Today(),
      wDay2:DateAdd(Today(),1,Days)
   }
   Filter(
      Taaks,
      (
         IsBlank(Title8.Text) ||
         Medewerker.Weergavenaam = Title8.Text
      ) &&
      Startdatum > wDay1 && Startdatum < wDay2
   )
)

 

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.

View solution in original post

Hi @WarrenBelz ,

 

Thank you for your reply.

I've changed my the column type to date only. For now it's OK to use that type of data and I've no delegation issue anymore.

 

Thanks again and have a nice day!

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,773)