cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ZowieS
Advocate II
Advocate II

Problem with date formation

Hi,

 

I'm trying to create All day events in a calendar with Create Event (V4) and the format it wants is "yyyy-MM-ddThh:mm:ss" 

2020-04-23 14_03_49-Edit your flow _ Power Automate.png

 

I've been trying to format the date but I'm unsuccessful.

I've been trying:

  • @formatdatetimetriggerBody()?['FromDate'],'yyyy-MM-ddThh:mm:ss')
  • formatdatetime(triggerBody()?['FromDate'],'yyyy-MM-ddThh:mm:ss')
  • "@formatdatetime(triggerBody()?['FromDate'],'yyyy-MM-ddThh:mm:ss')"
  • "formatdatetime(triggerBody()?['FromDate'],'yyyy-MM-ddThh:mm:ss')"
  • @formatdatetime(outputs['FromDate'],'yyyy-MM-ddThh:mm:ss')

 

This is how it's now:

2020-04-23 15_13_28-Edit your flow _ Power Automate.png

And the result is:

2020-04-23 15_13_20-Run History _ Power Automate.png

 

Is my formatting wrong or do I need to use "addMinutes" or something?

Or perhaps both?

 

Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
ZowieS
Advocate II
Advocate II

Hi,

 

I've solved it. 😁

I didn't know that you need/could to go back and fourth between Dynamic content and Expression

So I did as in this video but with Compose.

 

Thank you for you help @RobElliott@ManishJain & @ChristianAbata!

 

The solution:

Expression: 

formatDateTime(outputs('Create_item_from_the_MS_Form_response')?['body/FromDate'],'yyyy-MM-ddThh:mm:ss')

2020-04-23 19_32_14-Edit your flow _ Power Automate.png

 

2020-04-23 19_32_47-Run History _ Power Automate.png

View solution in original post

6 REPLIES 6
ChristianAbata
Super User II
Super User II

hi pleasee @ZowieS  see this, you need to change in expressions part, to add the fuction.

 

ex.PNG



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA
ManishJain
Solution Sage
Solution Sage

Hi @ZowieS ,

 

use your formula in expression part. Capture.JPG

Hi @ManishJain and @ChristianAbata,

 

Thank you for your help!

 

I've tried that but that didn't work.

 

The Expression is: formatdatetime(triggerBody()?['FromDate'],'yyyy-MM-ddThh:mm:ss')

2020-04-23 18_28_59-Edit your flow _ Power Automate.png

And the result was:

2020-04-23 18_26_01-Run History _ Power Automate.png

 

 

Also, the FromDate is from a Sharepoint list and the column typ is Date and Time:

2020-04-23 18_31_55-Window.png

@ZowieS one thing to remember is that the case inside the expression needs to be correct. You've got formatdatetime all in lower case whereas it should be formatDateTime.

Rob
Los Gallardos
If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.

Hi @RobElliott,

 

Ah, didn't know it was case sensitive in the Expression.

But sadly it still didn't work 

2020-04-23 19_01_59-Run History _ Power Automate.png

 

Do I need to convert the date to string first and then convert it back to date for the Create Event (V4)?

ZowieS
Advocate II
Advocate II

Hi,

 

I've solved it. 😁

I didn't know that you need/could to go back and fourth between Dynamic content and Expression

So I did as in this video but with Compose.

 

Thank you for you help @RobElliott@ManishJain & @ChristianAbata!

 

The solution:

Expression: 

formatDateTime(outputs('Create_item_from_the_MS_Form_response')?['body/FromDate'],'yyyy-MM-ddThh:mm:ss')

2020-04-23 19_32_14-Edit your flow _ Power Automate.png

 

2020-04-23 19_32_47-Run History _ Power Automate.png

View solution in original post

Helpful resources

Announcements
MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Users online (37,990)