Power Automate OData filtering returns zero results

Genther, Daniel 1 Reputation point
2021-09-21T20:29:36.017+00:00

I'm having trouble getting any results to display when I try to filter for items created last week in. I have exhausted all the options out there with the different ways to achieve this filtering of my Sharepoint list. To summarize what I'm trying to accomplish: I'm getting MS form submissions that then populate my Sharepoint list. I then want to create a Power Automate flow that occurs once a week and this flow gets the data from this Sharepoint list, filters it by items created last week as well as a specific brand. This new filtered data would then create a .CSV which would email out to a specific person these specific entries from last week.

I have successfully filtered by one condition (Brand contains xxxx) but when I try to filter for items created last week, it gives me an output but yields no results so there is no error message associated with it. I have tried the following:

  • Ensuring that the column is the correct naming convention by going under list setting and editing the column that I'm looking for (I've tried multiple columns that include the date field)
  • The formula that I have been using under the OData filter query in the Get Items action is:
    134113-image.png

I then get an email (currently using Create HTML table and send an email to vet if filtering is working)

134083-image.png

If I update the formula to be less than (le) I do get results:

134131-image.png

And I am sure that I do have items that are Greater than 7 days from last week:

134123-image.png

I have also tried using the condition actions and the filter arrays and neither one of those will work as far as getting me data. It ends up not even filtering for the dates and just giving me the whole list.

I have also tried several iterations of the formula but am open to suggestions to try and get this right.

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,755 questions
Not Monitored
Not Monitored
Tag not monitored by Microsoft.
36,286 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Echo Du_MSFT 17,116 Reputation points
    2021-09-22T07:09:15.77+00:00

    Hello @Genther, Daniel ,

    Welcome to Q&A Forum!

    Please confirm the following points:

    1.Whether the Date value is equal to the value of "Created" column

    2.You can add a Compose action to check the value of the function you define.

    For example: My current time is 9/22/2021, and the value of addDays(utcNow(),-7,'yyyy-MM-dd') is 9/15/2021

    134252-s1.png

    134253-s2.png

    3.The operators meaning:

    • ge: Greater than or equal to
    • le: Less than or equal to

    For example:

    • Created ge '9/15/2021'

    It means filter items that "DateOnly" after September 15, 2021(includeing 9/15/2021)

    • Created le '9/15/2021'

    It means filter items that "DateOnly" before September 15, 2021(includeing 9/15/2021)

    Therefore, if you only need to get items created in the previous week, then it is recommended that you use ge;
    If you want to get items created before the this week, then it is recommended that you use le

    Thanks,
    Echo Du

    ======================

    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.