Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Answered

Error building scheduled email

(0) ShareShare
ReportReport
Posted on by 12

Hi, I'm attempting to build a flow on a sharepoint list to send an automated email when an item has gone past it's due date however I am facing this error.

 

The expression "Due Date lt '2021-15-42'" is not valid. Creating query failed.
clientRequestId: 1799b375-1c42-4019-b462-d8fd6987e4d0
serviceRequestId: 1799b375-1c42-4019-b462-d8fd6987e4d0

 

Wondering if anyone could help me out with this? Thank you 

  • JamaalMoosa Profile Picture
    12 on at
    Re: Error building scheduled email

    Hi @Expiscornovus 

     

    I inputted your recommendation and have successfully managed to get the flow working!

     

    Thanks a lot for all your help 🙂 

  • Verified answer
    Expiscornovus Profile Picture
    31,630 Most Valuable Professional on at
    Re: Error building scheduled email

    Hi @JamaalMoosa,

     

    Just to double check. Are you still getting the expression error (Creating query failed). 

     

    Or do you mean that the flow is not sending an email for the items which are passed their due date?

     

    Btw, initially I thought you were comparing it with a fixed date. But if you want to see if the due date has passed this expression is probably a bit easier for the filter query

    DueDate lt '@{utcNow()}'

     

  • JamaalMoosa Profile Picture
    12 on at
    Re: Error building scheduled email

     

    Hi @Expiscornovus I have attached a picture below of the site name

    JamaalMoosa_0-1613407385635.png

    I did attempt the flow again also using the alternative site name but neither worked. Attached below is a picture of my input. Any ideas? Sorry to be a pain!

     

    JamaalMoosa_1-1613411141334.png

     

     

     

  • Expiscornovus Profile Picture
    31,630 Most Valuable Professional on at
    Re: Error building scheduled email

    Hi @JamaalMoosa,

     

    Can you check what the internal name of the field is? It might be DueDate instead of Due Date. Typically SharePoint removes spaces on creation.

     

    So the expression also might be the below instead:

    DueDate lt '@{formatDateTime('2021-12-30')}'

    checkname_field.png

     

    Also make sure you switch to the advanced mode when pasting the filter query. 

    internalnamefield_filterquery.png

     

  • JamaalMoosa Profile Picture
    12 on at
    Re: Error building scheduled email

    Hi @Expiscornovus thank you for your response! 🙂 my due date is in the form mm/dd/yyyy picture also attached. 

    JamaalMoosa_0-1613398967620.png

    I tried inputting the expression you suggested but faced this error this time:

     

    Action 'Get_items' failed

    The expression "Due Date lt '2021-12-30T00:00:00.0000000'" is not valid. Creating query failed.
    clientRequestId: efda1e1e-1ccf-4fca-b846-c7181ef6336d
    serviceRequestId: efda1e1e-1ccf-4fca-b846-c7181ef6336d

     

    Any ideas?

  • Expiscornovus Profile Picture
    31,630 Most Valuable Professional on at
    Re: Error building scheduled email

    Hi @JamaalMoosa,

     

    Just to double check, your due date field in the SharePoint list is column of datetime type, correct?

     

    If so, you are comparing a datetime field with a string value. 

     

    When you are using this in a filter query of a Get Items action I would use the following expression instead:

    Due Date lt '@{formatDateTime('2021-12-30')}'

     

    Btw, I have change your date value too, because that is invalid 😉

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,522 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,890 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow