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 / AddDays expression sto...
Power Automate
Answered

AddDays expression stopped working

(0) ShareShare
ReportReport
Posted on by 29

Hi all,

 

So I have this flow all set up and working fine. Basically I wanted it to get items from SharePoint on en regular basis(Scheduled), and from here I have a few conditions for the flow to kick of and in the end send out an email, and this all worked fine..no errors!

 

In my get items step I also have a filter query that look like this:

SHPdateColumn eq 'addDays(utcNow(),4,'dd-MM-yyyy')' 

 

Now just to underline this...the above filter did work just a few days ago, right up untill the point where it didn't.

 

But now Power Automate simply wont axcept this anymore and fails whenever I test run the flow with the below error:

 

"String was not recognized as a valid DateTime. Creating query failed.
clientRequestId: ae07324f-c02d-4d55-9204-3b6c9220d928
serviceRequestId: ae07324f-c02d-4d55-9204-3b6c9220d928"

 

I realize it's now easy to assume something is wrong with the query filter, but the fact is that it worked. It even returns the correct date which is today + 4 days, so I can't see what the problem is. I under stand what the error is trying to tell me, but it makes no sense.

 

Has anyone experienced anything like this? I am condidering creating a ticket with Microsoft, but wanted to check here first, just to see if anyone has an idea of what is going on.

 

 

 

Categories:
  • Verified answer
    Heartholme Profile Picture
    1,278 Super User 2024 Season 1 on at

    Hi @Michael_Larsen ,

     

    That's strange. You could try this, since the error message complains on the format string. 

     

    formatdatetime(addDays(utcNow(),4),'dd-MM-yyyy')
     
    However, this works for me:
     
    addDays(utcnow(),4,'dd-MM-yyyy')
     
    You could try to put the experssion into a compose and then refrence that, might make it more robust: 
    Heartholme_0-1668066344060.png
     
    { If my post answered your question, please Accept it as a solution ✔ }
    { This will in turn help others find solutions to similar questions }

    Best Regards
    Heartholme
  • Michael_Larsen Profile Picture
    29 on at

    Hi @Heartholme,

    Interesting that you have issues as well! It really does point to MS having some issues.

    Even more interesting that you can make the expression I am using work on your tenant, that just makes zero sense.

     

    I tried all kinds of different approcahed, following every guide to do this known to man, hell I even tried praying to my danish heathen gods, but alas to no avail ;)!

     

    The compose things is generally speaking a better idea though, but this point this wont work for me either. 

  • Heartholme Profile Picture
    1,278 Super User 2024 Season 1 on at

    Hi again @Michael_Larsen ,

     

    I also think this might be a bug in the editor, so remove it and add it again and see if it works? 

     

    If not, I hope Odin will guide our ways to find the root of the issue. 

     

    You could also try to change the format on the column in sharepoint, but this should'nt be an issue: 

     

    Heartholme_1-1668068579532.png

     

    Lykke til! 

    Best Regards
    Heartholme

     

     

     

  • Verified answer
    Michael_Larsen Profile Picture
    29 on at

    Hi again @Heartholme 

    So in a baffling turn of events, I managed to get this thing to work. 

    I simply changed addDays(utcnow(),4,'dd-MM-yyyy') to addDays(utcnow(),4,'yyyy-MM-dd').

     

    So basically I pulled ye ol' switch-er-oo on it, which made it spring to life. It still makes absolutely no sense, since I tried this yesterday without luck, but now it seems to be the only way to make it work. 

     

    The how, what and why still eludes me, but I will take the win!

     

    Tak for hjælpen!

     

    Best regards

    Michael

  • Heartholme Profile Picture
    1,278 Super User 2024 Season 1 on at

    Great, well done! 

     

    It's actually quite good to use yyyy-MM-dd date format on most actions (even though your contries format is dd-MM-yyyy), since this is the standard format for most applications/APIs, and then format it in the last step in the flow/App, when the information is meeting the end user.

     

    Bare hyggelig! 😄

     

    //Joachim

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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 425

#2
11manish Profile Picture

11manish 323 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 274

Last 30 days Overall leaderboard