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 Platform Community / Forums / Power Automate / Filter Array code - re...
Power Automate
Unanswered

Filter Array code - reminders

(0) ShareShare
ReportReport
Posted on by

Hi

 

I created a Flow to spit out reminders for documents in Sharepoint due some help earlier from the community.

However they want to make some drastic changes to how the reminders are going to be spit out.

 

Below some more information on what we have and where we want to go to;

 

We have a Sharepoint library that all documents will be stored under the folder 'Huur'.

Important columns here will be 'Startdatum, 'Eind Triennaat' and 'Einde contract'.

TORFS_BE_0-1714637644045.png

 

 

The flow step by step;

 

 

TORFS_BE_1-1714637733711.png

 

The "Filter Array" is where the magic happens;

What I currently have before the adjustments of columns and such (array is out of date now)

@Or(
equals(addDays(item()?['Vervaldatum'], mul(int(string(coalesce(item()?['RemindMeXDaysBeforeExpire'], 9999))), -1), 'yyyy-MM-dd'), body('Convert_time_zone')),
equals(addDays(item()?['Vervaldatum'], -7, 'yyyy-MM-dd'), body('Convert_time_zone')),
equals(addDays(item()?['Vervaldatum'], -30, 'yyyy-MM-dd'), body('Convert_time_zone')),
equals(addDays(item()?['Vervaldatum'], -60, 'yyyy-MM-dd'), body('Convert_time_zone')),
equals(addDays(item()?['Vervaldatum'], -90, 'yyyy-MM-dd'), body('Convert_time_zone'))
)

 

And what we basically want now;

We still want reminders but seperated in MONTHS instead of days/weeks and diff columns.

 

1. Reminders column "Eind Triennaat" : every 7 and 8 months before this date occurs

2. Reminders column "Einde contract": every 16 and 18 months before this date occurs

 

TORFS_BE_2-1714637810205.png

 

 

We notify them by email; 

TORFS_BE_3-1714638312900.png

 

 

Could someone help me adjust the Filter Array please? Sadly i'm not an expert in understand what to adjust to become this.

thank you!!

 

 

Categories:
I have the same question (0)
  • YaminiBharathiK Profile Picture
    62 on at

    Hi ,

     

    From your query what i understood the solution could be,

     

     1. Reminders column "Eind Triennaat" : every 7 and 8 months before this date occurs:-

     

     

    "Add group", "Add" 2 rows with "And" condition as shown in below image

    in first condition, lessOrEquals(addDays(body('Convert_time_zone'), -210, 'yyyy-MM-dd'),Eind Triennaat)

    in Second condition , greaterOrEquals(addDays(body('Convert_time_zone'), -240, 'yyyy-MM-dd'),Eind Triennaat)

     

     

    YaminiBharathiK_0-1714664190401.png

     

     

    Similarly you should follow for "2. Reminders column "Einde contract": every 16 and 18 months before this date occurs:"

     

    in first condition, lessOrEquals(addDays(body('Convert_time_zone'), -480, 'yyyy-MM-dd'),Eind Triennaat)

    in Second condition , greaterOrEquals(addDays(body('Convert_time_zone'), -540, 'yyyy-MM-dd'),Eind Triennaat)

     

    Hope it helps.

     

    Thanks.

  • TORFS_BE Profile Picture
    on at

    Hi @YaminiBharathiK 

     

    Thanks for the reply and suggestion.

    I'll try to understand what you said but i'm not good at this, just saying 🙂

     

    First; How do you add 2 conditions?? When I add it, only 1 is shown..

    2nd; What exactly do I enter here? (see what I did below in screenshot)

    3rd; Where do I place this into my flow itself? Remove the "Filter Array" and replace it by this? and if the condition is YES -> send an email (the part I used in my previous flow)

     

    Also, how do these all link together? Choosing between "Einde Trinnaat" and "Einde Contract" or is the system that smart 🙂

     

    TORFS_BE_0-1714724030414.png

     

    Sorry for my questions, I find it hard to read the steps and see the logic in it..

     

     

     

    TORFS_BE_3-1714724128064.png

     

     

     

     

     

  • YaminiBharathiK Profile Picture
    62 on at

    Hi,

     

    Yes what i believe is replacing filter array with if condition can make it easy to form an expression with "And" and "Or" and easily readable. I think you need all your existing conditions with two below new conditions,

    @Or(
    equals(addDays(item()?['Vervaldatum'], mul(int(string(coalesce(item()?['RemindMeXDaysBeforeExpire'], 9999))), -1), 'yyyy-MM-dd'), body('Convert_time_zone')),
    equals(addDays(item()?['Vervaldatum'], -7, 'yyyy-MM-dd'), body('Convert_time_zone')),
    equals(addDays(item()?['Vervaldatum'], -30, 'yyyy-MM-dd'), body('Convert_time_zone')),
    equals(addDays(item()?['Vervaldatum'], -60, 'yyyy-MM-dd'), body('Convert_time_zone')),
    equals(addDays(item()?['Vervaldatum'], -90, 'yyyy-MM-dd'), body('Convert_time_zone'))
    )

    and 

     

    We still want reminders but seperated in MONTHS instead of days/weeks and diff columns.

    1. Reminders column "Eind Triennaat" : every 7 and 8 months before this date occurs

    2. Reminders column "Einde contract": every 16 and 18 months before this date occurs

     

    coming to your question , "Also, how do these all link together? Choosing between "Einde Trinnaat" and "Einde Contract" or is the system that smart",

     

    what i understood here is you want to compare

      new condition 1 ,"System date" with "Einde Trinnaat" for 7 or 8 months.

    and

    new condition 2, "System date" with "Einde contract": for 16 or 18 months.

     

    So, Your first "And" group has 2 conditions, 

     lessOrEquals(addDays(body('Convert_time_zone'), -210, 'yyyy-MM-dd'),Eind Triennaat)

    greaterOrEquals(addDays(body('Convert_time_zone'), -240, 'yyyy-MM-dd'),Eind Triennaat)

     

    So, Your Second "And" group has 2 conditions, 

     lessOrEquals(addDays(body('Convert_time_zone'), -210, 'yyyy-MM-dd'),Einde contract)

    greaterOrEquals(addDays(body('Convert_time_zone'), -240, 'yyyy-MM-dd'),Einde contract)

     

    YaminiBharathiK_0-1714726247205.png

     

     

    if you don't like this approach, you can keep the "filter array" then just add your new two rules in new "if conditions" and in "yes", "Send mail"  action. 

  • TORFS_BE Profile Picture
    on at

    Hi @YaminiBharathiK 

     

    Sorry for my late reply. I hope you can still find the time too look to my reply.

     

    I have tried to understand and configure the things you mentioned above.

    This is what I came up with so far;

     

    Remove the current Filter Array & Apply to each to place it into the new condition.

    Created the 4 reminders and split them (2 for each group/column)

     

    But... I'm still confused and cant figure it out what to place in my condition rows on top (red boxes).

    I tried to test with a new document and set the dates 7 & 16 months in the future.. but no reminder was spit. Except I got plenty of reminders of old documents that are in the library.. (those dates dont make sense right now)

     

    TORFS_BE_0-1715599673269.png

     

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 463

#1
Valantis Profile Picture

Valantis 463

#3
11manish Profile Picture

11manish 264

Last 30 days Overall leaderboard