cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Problem with ISO 8601 on a SharePoint date

Hello,

 

I'm struggling with a problem on a SharePoint date not in ISO 8601 format.

 

 formatDateTime('triggerBody()?["Created"]''dd/mm/yyyy hh:mm tt')
 
It returns that the submitted date/hour chain is not valid and must match the ISO 8601 format. I tried converting the date to ISO format using the convertToUtc() function, still returned that in order to use this function I need a valid date.
 
I'm really stuck with this issue, could someone help me figure this out please ?
1 ACCEPTED SOLUTION

Accepted Solutions
v-bacao-msft
Community Support
Community Support

 

Hi @Anonymous ,

 

We should add '' outside Created and need to remove '' outside the triggerBody()?[‘Create’].

Image reference:

86.PNG

Hope this helps.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
efialttes
Super User
Super User

Hi!

TRy this instead:

formatDateTime(triggerBody()?['Created'], 'dd/mm/yyyy hh:mm tt')

 

Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Anonymous
Not applicable

Unfortunately it cannot help, there is a larger function around, at first I used the single quotes, still got me the same error.

 

 

Hi!

I am afraid the sintaxis from your first expression IS wrong.

You can simply add a dummy 'Compose' action block before the action block where your flow crashes, then assign my suggested expression as its input. REexecute the flow, see if it works

 

If it does, just share the whole expression (with the larger function around) so we can try to help putting the pieces together

Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Jcook
Super User
Super User

Hello @Anonymous 

 

Can you try to use the Convert time zone action. This will ensure your format matches ISO format

pic1.png

 


Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips,
tricks, and guides
FlowAltDelete





v-bacao-msft
Community Support
Community Support

 

Hi @Anonymous ,

 

We should add '' outside Created and need to remove '' outside the triggerBody()?[‘Create’].

Image reference:

86.PNG

Hope this helps.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Anonymous
Not applicable

That worked like a charm, thank you ! 🙂

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,208)