Skip to main content
Community site session details

Community site session details

Session Id : 2Vc7/vlwC7TtOKjAKWifHF
Power Automate - Building Flows
Answered

Get files (properties only) filter query by specific date

Like (0) ShareShare
ReportReport
Posted on 22 Sep 2023 13:31:21 by 165

Hi,

 

I have request via power automate get file properties only from Sharepoint, but I should filter out specific file.

From get files properties only I can get file created date, BUT I need filter out only files, which have current date = target date, but target date = file create date + 5 working days.

In Sharepoint I have list with files, which created in 14/09, 15/09, 18/09, 19/09, 20/09 etc., Today = 22/09, that mean with function get files only properties I should receive ONLY files, which created in date 15/09.

File create date = 15/09 + 5 working days = 22/09 = current date

How to set-up this via Filter Query?

slvedva_0-1695389448274.png

 

  • Matthy79 Profile Picture
    4,178 Super User 2024 Season 1 on 26 Sep 2023 at 09:01:03
    Re: Get files (properties only) filter query by specific date

    You can look at all the expressions in the Microsoft documentation.

     

    utcNow returns the current time stamp.

    addDays adds the amount of days you provide.

    -7 in that case takes you Bach 7 days.

    startOfDay gives you the time stamp of the beginning of the day provided.

     

    And we agreed that you don’t need to check for the weekday.

  • slvedva Profile Picture
    165 on 26 Sep 2023 at 08:13:15
    Re: Get files (properties only) filter query by specific date

    @Matthy79 please is it possible a little bit explain more details this expression, what mean each of these numbers like -7, 6, -6, -6? Thanks in advance!

    if(equals(dayOfWeek(utcNow()),0),startOfDay(addDays(utcNow(),-7)),if(equals(dayOfWeek(utcNow()),6),startOfDay(addDays(utcNow(),-6)),startOfDay(addDays(utcNow(),-6))))
  • Matthy79 Profile Picture
    4,178 Super User 2024 Season 1 on 25 Sep 2023 at 14:12:55
    Re: Get files (properties only) filter query by specific date

    Hello @slvedva,

     

    if you read your request and the provided solution from @ManishSolanki it is exactly what you requested.

     

    From the other topic I remember that you also have a filter of a specific user. If you put those filters together (using and) it will work for you.

     

    Try to combine those 2 filters and if it doesn’t work, provide what you tried.

  • slvedva Profile Picture
    165 on 25 Sep 2023 at 13:57:34
    Re: Get files (properties only) filter query by specific date

    @Matthy79 yes, but it's nothing related to file create date. It's just calculate 5 working days from current date and output system give 19-09-2023, BUT when get file filter by created 19-09-2023, the output is empty, because in my example files created in 12-09-2023. And I can't use input date, because flow is scheduled and run every day.

    In compose I put this formula: 

    if(equals(dayOfWeek(utcNow()),0),startOfDay(addDays(utcNow(),-7)),if(equals(dayOfWeek(utcNow()),6),startOfDay(addDays(utcNow(),-6)),startOfDay(addDays(utcNow(),-6))))
    Today system show in output: 2023-09-19T00:00:00.0000000Z, but when I run yesterday, system show the same date 2023-09-19.
  • Matthy79 Profile Picture
    4,178 Super User 2024 Season 1 on 25 Sep 2023 at 13:25:00
    Re: Get files (properties only) filter query by specific date

    There are always a lot of ways.

     

    In your special case (since holidays don't matter) you could always check for current day -7. You already have a perfect solution provided by @ManishSolanki. Just use -7 and -6 instead of -5 and -4 from his first post.

     

    Of course you could also create a flow that is triggered when a new file is added and after that wait for 7 days and check if the file has been updated but the flow setup would be completely different.

  • slvedva Profile Picture
    165 on 25 Sep 2023 at 12:50:22
    Re: Get files (properties only) filter query by specific date

    @Matthy79 maybe there are some possibility create additional flow, when file is created, system update file some field with some notification date, which calculate create date + 5 working days and which later can be used for filtering?

  • slvedva Profile Picture
    165 on 25 Sep 2023 at 12:44:30
    Re: Get files (properties only) filter query by specific date

    Hi @Matthy79 

    Sorry my mistake and you are correct

    13-09-2023 - yes, it's working day 1

    14-09-2023 - working day2

    15-09-2023 - working day3

    18-09-2023 - working day4

    19-09-2023 - working day5 and flow I run automatically every working day. In my case don't matter holidays, I talk 5 working days in week.

  • Matthy79 Profile Picture
    4,178 Super User 2024 Season 1 on 25 Sep 2023 at 12:36:07
    Re: Get files (properties only) filter query by specific date

    Honestly I don’t understand the explanation. Let me explain the problem I have. Tried to add comments in red.

     

    In your example the files are created 12-09-2023 (Tuesday)

    When flow run 12-09-2023 and get files it is the same day so no working day in between;

    when flow run 13-09-2023 (Wednesday) and get files it is the next working day (day 1);

    Why do you leave out 14-09-2023 (Thursday). This would be day 2

    when flow run 15-09-2023 (Friday) and get files it is day 3;

    16 and 17 are Saturday and Sunday (no working days so no count)

    when flow run 18-09-2023 and get files, system filter all created files. I don’t under why this is day is day 5 for you. For me it is working day 4

    when flow run 19-09-2023 and get files, system don't filer anything; (for me this would be the 5th working day)

    when flow run 20-09-2023 and get files, system don't filer anything etc;

     

    Also a big problem with working days is that there are different holidays in each country. You will have to match everything against your holidays.

  • slvedva Profile Picture
    165 on 25 Sep 2023 at 12:02:52
    Re: Get files (properties only) filter query by specific date

    Hi @Matthy79 

    Maybe you can help with my issue? Thanks.

  • slvedva Profile Picture
    165 on 24 Sep 2023 at 19:19:58
    Re: Get files (properties only) filter query by specific date

    Hi @ManishSolanki 

     

    Maybe I need more detail describe situation.

    This flow I plan schedule automatically every working day and when flow run, system should check SharePoint files create date and 5 working days after file creation system will send out reminder, that mean when get files, it should filter files 5 working days after creation in other days don't filter at all.

    Try describe example:

    I have files created in 12-09-2023

    When flow run 12-09-2023 and get files, system don't filter anything;

    when flow run 13-09-2023 and get files, system don't filer anything;

    when flow run 15-09-2023 and get files, system don't filer anything;

    when flow run 18-09-2023 and get files, system filter all created files;

    when flow run 19-09-2023 and get files, system don't filer anything;

    when flow run 20-09-2023 and get files, system don't filer anything etc;

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

Announcing our 2025 Season 2 Super Users!

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 986 Moderator

#2
stampcoin Profile Picture

stampcoin 699 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 577 Super User 2025 Season 2