Hello, i am trying to create an ODATA filter to only pull records that are X days old. right now i am just trying to pull the list, put that data in an HTML table and then email it to myself. i see my records when i remove the filter, but not when i have it on, i just get an empty email.
i have tried both of these, but neither seems to work.
Created eq 'body('Get_Past_time')'
Created eq 'formatDateTime(body('Get_Past_time'),'yyyy-MM-dd')'
Created is the date the record was created on my SP list, Get past time is currently set to 35 Days, meaning i should be pulling any record that was created on 1/1/23.
What am i doing wrong here?
@wskinnermctc @happyume my Created field includes time, so the full value is something like 2023-04-03T14:23:28Z. do i need to apply a formula to my created field so that it strips the time and leaves only the date? could that be why it's coming up with zero records?
@happyume the datetime functions have an optional format parameter, so the use of formatDateTime isn't necessary. I think people use it out of habit, but removing it cleans expressions up.
Created eq '@{addDays(utcNow(), -35, 'yyyy-MM-dd')}'
utcNow('yyyy-MM-dd') = formatDateTime(utcNow(),'yyyy-MM-dd')
addDays(utcNow(),35,'yyyy-MM-dd') = formatDateTime(addDays(utcNow(),35),'yyyy-MM-dd')
convertfromUtc(utcNow(), 'Central Standard Time', 'yyyy-MM-dd')
Just an FYI for examples
Created eq '@{formatDateTime(addDays(utcNow(), -35), 'yyyy-MM-dd')}'
Use^ above in the Filter Query area
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 this post or my previous reply was useful in other ways, please consider giving it Thumbs Up.
Michael E. Gernaey
497
Super User 2025 Season 1
David_MA
436
Super User 2025 Season 1
Riyaz_riz11
244
Super User 2025 Season 1