web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Get items OData filter
Power Automate
Answered

Get items OData filter

(0) ShareShare
ReportReport
Posted on by 27
Hi
 
I am trying to make use of the odata filter in the SharePoint connector get items. I have tried several different ways but I just can't get it to filter to only get items that are 90 days old. I've tried other similar referenced solutions for similar queries in the community. It's also worth pointing out I have another way to calculate the 90 days later in the flow, but it means I have 3 compose steps and a condition step. If I could get it working in the odata filter line it means I could cut these out, as it takes 3 seconds per item to run through the compose functions. When I have a list of 1800 to run through, it would be good to only pull the items that need action as per the filter and speed up the flow.
 
I have a sharepoint list called Date Access Granted (picked up as DateAccessGranted).
 
I have tried
 
DateAccessGranted eq date(addDays(utcNow(), -90)
DateAccessGranted eq formatDateTime(addDays(utcNow(), -90), 'yyyy-MM-dd')

Can anyone help me with where I am going wrong?
 
Categories:
  • ScottShearer Profile Picture
    25,331 Most Valuable Professional on at
    Try putting single quotes around your formatDateTime() expression
     
    DateAccessGranted eq 'formatDateTime(addDays(utcNow(), -90), 'yyyy-MM-dd')'
  • chris9486 Profile Picture
    27 on at
    Thanks @ScottShearer. It didn't work. I get the attached error when I ran it. For testing purposes I put a terminate after the get items function which is why it ran so quickly. I feel like I am going nuts, it should work. Even if I remove the formatDateTime out, it doesn't work. I am led to believe I need this in for it to work correctly with the SharePoint list, and other parts of my flow where it writes dates in with the formatDateTime expression, it writes them correctly.
     
  • Verified answer
    ScottShearer Profile Picture
    25,331 Most Valuable Professional on at
    I just created a Flow and a list with a date column with an internal name of DateAccessGranted.
    I used the following expression and it returned the data/rows that I wanted:
    formatDateTime(addDays(utcNow(),-90),'yyyy-MM-dd')
     
    My date column is not date and time - just date.
    90 days before today was July 31 2024.
     
    If you have items in your list with a date of 7/31/2024, please paste a screen shot of your
    SharePoint Get items action that shows the filter.
     
    Scott
     
  • chris9486 Profile Picture
    27 on at
    Thank you. I went and created a new list and set it to date only in list settings. Pointed a new flow to it and it worked.
     
    Checked the old list and the DateAccessGranted column was set to date only in the list settings. I just can't work out why it wouldn't work in that flow. Finished the flow off and it's working brilliantly.
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 425

#2
11manish Profile Picture

11manish 323 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 274

Last 30 days Overall leaderboard