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

Community site session details

Session Id :
Power Automate
Unanswered

formatdatetime error

(0) ShareShare
ReportReport
Posted on by 98

Getting the following error message

 

InvalidTemplate. Unable to process template language expressions for action 'Condition' at line '1' and column '2876': 'In function 'formatDateTime', the value provided for date time string '256' was not valid. The datetime string must match ISO 8601 format.'.

 

What I'm trying to do is to create a flow that takes a record from List A, copies it to List B and then delete the record from List A.  My flow is based on a column that is a formula that adds days from another column.  For example, the column in question, Archive 2, is basically a formula that adds 120 days from date column.  This Archive 2 column is a date/time column set to Date only.

 

My flow syntax is:

formatDateTime(item()?['Archive_x0020_2'],'yyyy-MM-dd')

Is less than

addDays(utcNow(),-1,'yyyy-MM-dd')

 

So, when Archive 2 shows a date that is 1 day older than today's date, the flow activates.  This flow works perfectly when the column in question is the standard SharePoint Created date, not sure why it's not working on this column

 

Any ideas?

 

Categories:
I have the same question (0)
  • ScottShearer Profile Picture
    25,268 Most Valuable Professional on at
    Re: formatdatetime error

    @bryanc78 

    Are you using an OData filter?  If so, I don't believe that SharePoint calculated columns are supported in OData filters. 

     

     

  • bryanc78 Profile Picture
    98 on at
    Re: formatdatetime error

    @ScottShearer not sure what that is so I would say no

  • ScottShearer Profile Picture
    25,268 Most Valuable Professional on at
    Re: formatdatetime error

    @bryanc78 

    Please post a screen shot of your Flow.

     

     

  • bryanc78 Profile Picture
    98 on at
    Re: formatdatetime error

    @ScottShearer 

     

     

     

    1.png

     

  • Verified answer
    v-bacao-msft Profile Picture
    on at
    Re: formatdatetime error

     

    Hi @bryanc78 ,

     

    Please add a Compose action above Condition to output the value of the date field and show it to us so that we could provide a proper workaround for you.

    177.PNG

     

    Best  Regards,

  • Verified answer
    bryanc78 Profile Picture
    98 on at
    Re: formatdatetime error

    Thought I had answered this. I removed the first syntax and it worked.  Guess the formula that gave me a date didn't need to be converted

  • HarshavardhanG Profile Picture
    49 on at
    Re: formatdatetime error

    I have tried all the above solutions, but can't seem to get it working.

     

    I have raised a new post here: https://powerusers.microsoft.com/t5/Building-Flows/Format-timestamp-from-Excel-Online-to-send-mails/... 

     

    Can someone please guide me?

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 462 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 456 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard