Skip to main content

Notifications

Community site session details

Community site session details

Session Id : vWIkZI3nDgfdDWqg5TMcTc
Power Automate - Building Flows
Suggested answer

Sharepoint Get Items Filter Query

Like (0) ShareShare
ReportReport
Posted on 14 Mar 2025 08:45:51 by 2
Need one help to build logic…
Get items from SharePoint list by apply filter on created date (filter last week data only) AND filter description column to get data which contains substring(“ABC”, “PQR”, “XYZ”) in last week data only
  • Kshitij21 Profile Picture
    2 on 14 Mar 2025 at 14:39:40
    Sharepoint Get Items Filter Query
    Did you tested this solution?? (Solution Looks good :) )
     
    I have attached screenshot for both the cases.
     
    CASE-1:
    When I use last week filter and only one substring Data filter AND substringof('Jor', customer) it is working as expected.
     
     
    CASE-2:
    As soon as I added another filter Data filter AND substringof('Jor', customer) AND substringof('dan', customer) I am not getting any value.
     
  • Building with Why Profile Picture
    193 on 14 Mar 2025 at 12:48:25
    Sharepoint Get Items Filter Query
    You can also use 
    dayOfWeek(utcNow()) to return the current day of the week.  Today is Friday so it is 5.  You can use that find the start of the current week with addDay function and then the previous week with another addDay function.
     
    addDays(
    addDays(utcNow(), mul(dayOfWeek(utcNow()), -1))
    , -7)
    Which for today returns 2025-03-02T12:47:44.0081855Z
    You can format the date as desired.
  • Suggested answer
    rzaneti Profile Picture
    3,549 Super User 2025 Season 1 on 14 Mar 2025 at 12:06:13
    Sharepoint Get Items Filter Query
    Hi,
     
    I'm using this SP List as example, where I want to retrieve the record highlighted in red by filtering only the entries with due_date in last week's range, and with a few substrings in the customer name: 
     
    And then using the following expression, where all the conditions are concatenated with and operators:
     
    The both expressions used here are the same and assume that your flow will always run at the same day of week. In the example, it runs on Mondays, so the start date of the filter must be greater or equals to 11 days ago (last week's Monday) and lower or equals to 7 days ago (last week's Friday).
     
    If you want to run this flow at any day of the week and still capture the records from the previous week, you might need a more complex expression. Let me know if this is the case and I will build it for you. 
     
    I'm also sharing a few links of contents that I created about the topics discussed here and can be useful for you or other users that find this thread in the future:
    - Working with Filter Query in Power Automate: https://youtu.be/Ifqo1YKMiw0
     
    Let me know if it works for you or if you need any additional help!
     
    If this is the answer to your question, please mark the post as Accepted Answer.
    If this answer helps you in any way, please give it a like.

    Check more Power Platform content on my website.
    Lets connect on LinkedIn.

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

Thomas Rice – Community Spotlight

We are honored to recognize Thomas Rice as our March 2025 Community…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,508 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,431 Most Valuable Professional

Leaderboard
Loading started
Loading complete