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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Automate
Answered

Filtering Flow

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi there, 

I am in the middle of creating a flow that extracts data from a SP list, this in itself is relatively easy. 

However, I would now like to filter what data it extracts based on the date this was added, meaning  if it was added whithin a specific periode it should be extracted to one place, if it was added in a different period it should extract it to a different place. 

Eg. all data added to the SP list between the 21st and the 20th of two months should go to X location, and then a new period should start with the 21st to the 20th of the next months? so essentially create a "period" filter based on dates Smiley Happy 

Hope this makes sense, thanks in advance Smiley Happy 

- Tobi

Categories:
I have the same question (0)
  • manuelstgomes Profile Picture
    6,625 on at

    Hi @Anonymous 

     

    I think the easiest way is to do the following:

    1. Define the period(s) first. Is it easy to calculate it?
    2. Use a "case" to filter based on the periods.
    3. Do the actions that you need.

     

    Here's a skeleton so that you understand what I mean. 

     

    small-Screenshot 2019-09-17 at 15.23.30.png

     

    The advantages of using the "compose" is that you can convert the data and always be sure you're calculating the period correctly. After that, use the cases to filter to each of your periods. 

     

    Does this make sense? If I missed something, please provide some more information or examples of periods so that I can help you create the formulas.

     

    Cheers!

     

    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.

    Cheers
    Manuel

     

  • v-alzhan-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

     

    You should create flow as below:

    1.png

    And please create a "period" in the Condition then do something you want.

     

    Best regards,

    Alice       

     

    Community Support Team _ Alice Zhang
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @manuelstgomes 

    I will definately try this out, I'll let you know if this fixes the issue 🙂 

    - Cheers

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @v-alzhan-msft 

    Hi Alice, Surely in this case i would have to manually add every single period, instead of being able to calculate the periods using a formulae of sorts, or is it because you have experience with this, and know that this works and the other method won't 🙂 

    Appreciate the answer, cheers. 
    - Tobi

  • manuelstgomes Profile Picture
    6,625 on at

    @Anonymous awesome!

    If you need help along the way or get stuck just let me know.

     

    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.

    Cheers
    Manuel

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @manuelstgomes  Perfect thanks, I will do 🙂 

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @manuelstgomes I am working away. 

    However, i'm finding myself getting stuck when writing the equation. 

    Essentially i am trying to say: Check if the date is between the 21st of last month and the 20th of this month; If yes, Return true and complete action, if not, Exit 🙂 

    But I just can't seem to get this right, if it is even possible 🙂  

  • Verified answer
    manuelstgomes Profile Picture
    6,625 on at

    Hey @Anonymous 

     

    Sure it's possible.

     

    Here's the flow:

     

    small-Screenshot 2019-09-19 at 11.58.48.png

    small-Screenshot 2019-09-19 at 11.58.48.png

    Regarding the formulas, let's get the 20th of last month. The first instinct is to get the number of the month and reduce it by one, but then you can run into issues (timezones, leap years, etc.). The best way to do this is to get the last month (using the formula for that), get the first day and add X days. Then you're always sure that you're calculating the correct date. With this in mind, here are the two formulas:

     

     

    addDays(startOfMonth(subtractFromTime(utcNow(),1,'Month')),20)

    and

     

     

    addDays(startOfMonth(utcNow()),19)

    Now it's just a question of comparing them and proceed with your flow.

     

     

    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.

    Cheers
    Manuel

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @manuelstgomes  

    It works, praise the heavens. 

    Had to work it a little bit as i was not the most consistent, but it works! 

    Thank so much 🙂 

  • manuelstgomes Profile Picture
    6,625 on at

    Awesome!!!!! Well done!

     

    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.

    Cheers
    Manuel

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 262 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 227

#3
Expiscornovus Profile Picture

Expiscornovus 225 Most Valuable Professional

Last 30 days Overall leaderboard