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

Filter date greater than date 5 days ago

Hey everyone thanks for reading.

 

I have a flow that I am pulling in Excel data and need to filter down to just rows where a 'CreatedAt' date is greater than or equal to the date 5 days ago. I have tried a couple approaches and nothing has worked for me.

 

I have tried using Odata query to filter when it is pulled in with this:

CreatedAt ge formatdatetime(addDays(utcNow(), -5), 'g')

 

This returns "An identifier was expected at position 13.

inner exception: An identifier was expected at position 13.

clientRequestId: 00629cb8-2260-4880-8dcf-07d829837bb1"

 

 

Even when I try using a constant date like: CreatedAt ge '2/6/2021' 

 

I receive an error that reads "Invalid filter clause: unsupported operation. Only single 'eq', 'ne', 'contains', 'startswith' or 'endswith' is currently supported.

clientRequestId: 1a0d7743-4913-4b99-875c-973f47bac751

serviceRequestId: 7f9de452-f532-4219-815f-a4d66114ddf8;3a863725-dd78-44ac-8fa2-c6a8f9ce9dc3;715449af-6494-48be-9b34-d68d810bb947"

 

The only thing that I have gotten to work here is: CreatedAt eq '2/6/2021' which is obviously not what I want.

 

I have also tried loading all of the rows and filtering using a filter array step. I have:

 

value

CreatedAt         greater than or equal to          formatdatetime(addDays(utcNow(), -5), 'g')

 

This runs and does not return any errors, but it doesn't filter anything. It just returns the same input file.

 

For the filter array I have a suspicion that there is an issue with the format of each of the two dates not matching up but I don't know how to go about fixing that. For the Odata query approach I have no idea. I'd appreciate any help.

1 ACCEPTED SOLUTION

Accepted Solutions
PrasadAthalye
Super User
Super User

Can you please use Subtract Time function like below? Then Format the date to your required format in order to compare. One more thing. If your excel date is in a specific time zone, you can convert UTCnow to that timezone using Convert Time zone action.

 

PrasadAthalye_0-1613093113418.png

 

Please Like and Mark this as Answer if it resolves your Issue.

Power Automate Community

View solution in original post

1 REPLY 1
PrasadAthalye
Super User
Super User

Can you please use Subtract Time function like below? Then Format the date to your required format in order to compare. One more thing. If your excel date is in a specific time zone, you can convert UTCnow to that timezone using Convert Time zone action.

 

PrasadAthalye_0-1613093113418.png

 

Please Like and Mark this as Answer if it resolves your Issue.

Power Automate Community

View solution in original post

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,055)