Skip to main content

Notifications

Power Automate - Building Flows
Unanswered

Error in Filter Query for Sending Notification 3 Days Before Date

Posted on 29 Nov 2024 20:01:40 by

I have a Power Automate flow that should send an email 3 days before a specific date.
I created a SharePoint list where the StartDateAndTime column contains the dates for which I want to receive a notification 3 days in advance.

In the Filter Query field, I entered the following code:

StartDateAndTime gt '@{formatDateTime(utcNow(), 'dd.MM.yyyy HH:mm')}' and StartDateAndTime lt '@{formatDateTime(addDays(utcNow(), 3), 'dd.MM.yyyy HH:mm')}'

When I test the flow, I encounter an error, and I’m not sure what’s causing it. Could it be the date format in the column, the filtering logic, or something else?
For additional context, the StartDateAndTime column is configured as a Date and Time type.

Does anyone know how to correctly configure the Filter Query so it works as expected?
Thank you in advance for your help!

  • creativeopinion Profile Picture
    creativeopinion 9,854 on 29 Nov 2024 at 23:59:29
    Error in Filter Query for Sending Notification 3 Days Before Date
    @CU29111912-0 First issue is with how you've formatted the date. It should be 8601 format yyyy-MM-ddTHH:mm:ssZ. Secondly, you may want to consider the logic of your filter query. In your post, you've indicated you want to send a notification 3 days in advance. Your addDays() function has a positive number which will add three days not subtract it from your StartDateTime. 
     
    I would recommend using Compose actions to ensure you output the correct timestamps first before using them in your filter query. 
     
    You might be interested in this YT Tutorial below. Although this specific tutorial uses a date only column, the concepts covered in this tutorial can be used in your flow.

    In this Microsoft Power Automate tutorial, I’ll show you how to build a flow that will send a Happy Birthday email to a user based on a date column in a SharePoint list. The SharePoint list also contains a column with a Manager’s name which we’ll use to send a three-day and day of reminder to the user’s manager.
    This automation will use the Filter Array action to filter out all SharePoint list items where the user’s birthday is today or in three days. This flow can apply to a variety of scenarios such as:

    đź“… Student Birthdays
    đź“… Project Due Dates
    đź“… Contract/Membership Renewals
    đź“… License Expirations
    đź“… Client Anniversaries

    IN THIS VIDEO:
    âś… How to Send an Email based on a Date Column in SharePoint
    âś… Using the Recurrence Trigger in Power Automate
    âś…How to Use the Filter Array Action with multiple conditions
    âś… How to Get Dynamic Content from a Filter Array Action
    âś…How to Get a Date Three Days from Today
    âś… How to Create a Dynamic Date Based on utcNow()
    âś… How to Return a Count of Items
    âś… How to initialize and set a variable
    âś… How to use the Send an Email (V2) action
    âś… How to send test emails



    Hope this helps!

    Consider giving me a ❤️ if you liked my response!

    👉 Level up your Power Automate skills by checking out my tutorials on YouTube
    👉 Tips and Tricks on TikTok and Instagram

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

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,168

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,851

Leaderboard