cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
etanshapiro
Level: Powered On

End time + minutes expression not working - when creating calendar event with flow


Trying to create a flow:

When an event (EventA) with a specific display name is created, automatically create a new event (EventB):

 

EventB's Start Time = EventA End Time

EventB's End Time = EventA End Time + 45 minutes (I'm using the addMinutes funciton)

 

When it runs I get this error:
Unable to process template language expressions in action 'Create_event_(V1)' inputs at line '1' and column '2164': 'The template language function 'addMinutes' expects a timestamp as the first parameter, the number of minutes to add as the second parameter, and an optional format string as the third parameter. The function was invoked with '1' parameter(s). Please see https://aka.ms/logicexpressions#addminutes for usage details.'

I'm having a hard time figuring out the proper expression to use.

Would be great if someone could provide me with the exact expression I need to use.

Thanks!


Screen Shot 2017-11-29 at 2.30.54 PM.png

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: End time + minutes expression not working - when creating calendar event with flow

Hi etanshapiro,

 

For your scenario, you could try to configure the End time field using the following function:
addminutes(triggerBody()?['End'],45)


Your flow might be configured to something likes below. Please enter the code under the Expression tab of the End time field.

3.PNG

 

More details about addminutes function, please see it at here:
https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-workflow-definition-language


Best regards,
Mabel Mao

Community Support Team _ Mabel Mao
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

3 REPLIES 3
Dual Super User
Dual Super User

Re: End time + minutes expression not working - when creating calendar event with flow

Hi!

What I see on the screenshot is that you have added one dynamic content and one expression (2 items) to "End time" in your Create Event action block instead of one. This means Flow editor will concat both the dynamic content and the expression result, meaning its format is not a valid one.

So, I would suggest to keep just the expression. THis is an example of a similar scenario that is working for me:

 

My expression is:

addHours(triggerBody()?['DateTimeReceived'],1)
 
And the way it is displayed in the editor is:
 
CreateEventExpression.png

 

Hope this helps





If anyone is trying to help you with an issue, the fastest way to say thanks is by kudoing. Be grateful, Thumbs up!

Proud to be a Flownaut!





Community Support Team
Community Support Team

Re: End time + minutes expression not working - when creating calendar event with flow

Hi etanshapiro,

 

For your scenario, you could try to configure the End time field using the following function:
addminutes(triggerBody()?['End'],45)


Your flow might be configured to something likes below. Please enter the code under the Expression tab of the End time field.

3.PNG

 

More details about addminutes function, please see it at here:
https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-workflow-definition-language


Best regards,
Mabel Mao

Community Support Team _ Mabel Mao
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

etanshapiro
Level: Powered On

Re: End time + minutes expression not working - when creating calendar event with flow

This worked perfectly! Thank you so much Mabel Smiley Happy

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!

Top Kudoed Authors (Last 30 Days)
Users online (5,954)