cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mlaw1986
New Member

The datetime string must match ISO 8601 format

I have a sharepoint list which stores"Business Response Date" as a Date.

 

I have a flow which Gets Items and then a query filter of:

Status eq 'Approved' AND @{addDays('Business_x0020_Response_x0020_Date',180)} gt @{utcNow()}

 

I get the error: The datetime string must match ISO 8601 format

 

I have tried various things including adding a 3rd parameter to addDays of 'yyyy-mm-dd' but I'm struggling to figure out what's wrong.

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @mlaw1986 

 

Use following expression :

 

Status eq 'Approved' and Business_x0020_Response_x0020_Date gt 'formatDateTime(addDays(utcNow(),-180),'yyyy-MM-dd')'

 

Date.jpg

 

Regards,

DS

View solution in original post

10 REPLIES 10
DeepakS
Super User
Super User

Hi @mlaw1986 

 

Try following expression:
 
Status eq 'Approved' AND 
addDays(formatDateTime('Business_x0020_Response_x0020_Date','yyyy-MM-dd'),180,'yyyy-MM-dd')
    gt
    formatDateTime(utcNow(),'yyyy-MM-dd')
 
Regards,
DS
 

Hi @DeepakS 

 

Thanks so much for replying.

I tried as you say and I now get:

"Unable to process template language expressions in action 'Get_items' inputs at line '1' and column '15867': 'In function 'formatDateTime', the value provided for date time string 'Business_x0020_Response_x0020_Date' was not valid. The datetime string must match ISO 8601 format.'."

Hi @mlaw1986

 

Can you add a compose action  before and check what value you getting in Business_x0020_Response_x0020_Date column?

 

Regards,

DS

Business_x0020_Response_x0020_Date output is 2019-12-12T12:01:00Z

Hi @mlaw1986 

 

Is this column is empty for any item?

 

Regards,

DS

No, I only have the 1 item in the list at the moment for testing.

Hi @mlaw1986 

 

Interesting, as the date format looks good. would you mind share the full screen capture of the Flow?

 

Regards,

DS

22062020.PNG

Hi @mlaw1986 

 

Use following expression :

 

Status eq 'Approved' and Business_x0020_Response_x0020_Date gt 'formatDateTime(addDays(utcNow(),-180),'yyyy-MM-dd')'

 

Date.jpg

 

Regards,

DS

View solution in original post

Brilliant, thank you!

I did have to change Business_x0020_Response_x0020_Date to Business_x0020_Response_x0020_Da. I'm guessing there's a max name length I've hit. I also changed gt to lt.

Thanks again!

 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (2,511)