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

Office 365 Calendar events with dynamic date

Hi all,

 

I want to create a flow that will create a new event in my Office 365 calendar.

So this works fine, but now I want that flow creates a event automaticly after I add an event to my calender and the start time should be one hour earylier.

I try the addhours(StartTime, -1) but always get an wrong time.

 

#Office365 #Calendar #Flow #Date #Outlook #Time #addhours

2 ACCEPTED SOLUTIONS

Accepted Solutions
Community Support Team
Community Support Team

Re: Office 365 Calendar events with dynamic date

Hi @Anonymous,

 

You should be able to identify the language through the following way:

1. First add the dynamic content (For example, the [Start Time] here) into the formula, just like you did before:

"@Addhours(body([Start Time], -1)"

2. Then save the flow, it will show you that the formula is not right, which would expose the code used for the dynamic content in the error messages part:

46.PNG

3. After that, remove the @{} symbol, which would leave only the contents body('Create_event')['Start'], then use this as the function parameter.

Hope this information would be helpful.

Adding the language reference:

Workflow Definition Language

Regards

Community Support Team _ Michael Shao
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

Re: Office 365 Calendar events with dynamic date

Hi @v-micsh-msft,

 

Now it works!

But I don´t get the name of the trigger.

I have tried this: "@Addhours(triggerBody()?['Start'], 1)"

With this everything works fine! 🙂

 

Thanks for your help!

View solution in original post

4 REPLIES 4
Community Support Team
Community Support Team

Re: Office 365 Calendar events with dynamic date

Hi @Anonymous,

 

Currently I can't find a successful way to writing code directly with the Start Time fields. Even the date would generated rightly, there would be a double quotes with the result if the code is writing directly with the Start Time fields, and this would make the start time not recognized by the Inputs as a correct time format.

The way I make it work is the following:

1. under the first Create Event Action, add a Compose Action, 

2. Use the following code as the Inputs of the Compose Action (with Double quotes): 

"@Addhours(body('Create_event')['Start'], -1)"

3. Add another Create Event Action, input the needed calendar, specify the End time with the previous Start Time (Dynamic content generated from Create Event Action), and the Compose Outputs as the Start Time:

36.PNG

The result is the following:

37.PNG38.PNG

 

 

Hope the information here would be helpful.

If you need any further assistance of the steps above, please post back.

Regards

Michael

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

Re: Office 365 Calendar events with dynamic date

Hi  @v-micsh-msft,

 

thanks for your answer.

So my problem is I use another trigger and a another language.

Where can I see the real names of a trigger (like Create_event)?

I want to use the "When a new event is created" trigger, in german (Wenn ein neuer Termin erstellt wird).

Can you tell me how I can get the name from this trigger?

Community Support Team
Community Support Team

Re: Office 365 Calendar events with dynamic date

Hi @Anonymous,

 

You should be able to identify the language through the following way:

1. First add the dynamic content (For example, the [Start Time] here) into the formula, just like you did before:

"@Addhours(body([Start Time], -1)"

2. Then save the flow, it will show you that the formula is not right, which would expose the code used for the dynamic content in the error messages part:

46.PNG

3. After that, remove the @{} symbol, which would leave only the contents body('Create_event')['Start'], then use this as the function parameter.

Hope this information would be helpful.

Adding the language reference:

Workflow Definition Language

Regards

Community Support Team _ Michael Shao
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

Re: Office 365 Calendar events with dynamic date

Hi @v-micsh-msft,

 

Now it works!

But I don´t get the name of the trigger.

I have tried this: "@Addhours(triggerBody()?['Start'], 1)"

With this everything works fine! 🙂

 

Thanks for your help!

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Users Online
Currently online: 331 members 6,486 guests
Please welcome our newest community members: