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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Sharepoint Get Items F...
Power Automate
Answered

Sharepoint Get Items Filter Query

(0) ShareShare
ReportReport
Posted on by 10
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
Categories:
I have the same question (0)
  • Suggested answer
    rzaneti Profile Picture
    4,285 Super User 2025 Season 2 on at
    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.
  • Building with Why Profile Picture
    351 Super User 2025 Season 2 on at
    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.
  • Kshitij21 Profile Picture
    10 on at
    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.
     
  • Verified answer
    rzaneti Profile Picture
    4,285 Super User 2025 Season 2 on at
     
    The query that I provided you will only retrieve records that contains all substrings into the text column from a same record. For your case, however, it looks like you need it to retrieve the records that contains one or another substring (all records that contains Hello1 or Hello2 in the customer column). 
     
    Here is a fix for your query: Created ge [dynamic_content] and Created le [dynamic_content] and (substring('Hello1', customer) or substring('Hello2', customer))
     
    We are basically grouping the substrings between the parenthesis and using the or operator instead of and, so it will return all records that have Hello1 or Hello2 as substrings from customer, plus are created before/after the dates set in the first two conditions :)
     
    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.
  • Suggested answer
    Kshitij21 Profile Picture
    10 on at
    Hello @rzaneti ,
     
    Very much thankyou for your kind support... it really helps me.
     
    Keep supporting and happy Automation :)

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 507 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 267 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard