cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Kosenurm
Helper V
Helper V

Concat function to set Outlook calendar event for correct date and time

Hi there,

 

I have a flow which has as a variable from a Canvas app the date of a particular event. I want this to then add a new event to the user's calendar for that date, with the time of 09:00 to 17:00

 

I have tried the variable output and then just written T09:00:00 next to it, but this doesn't work.

 

The output's command is "triggerBody()['GetDateValue']... I just want to hardcode the time onto this, so that the calendar event goes to that day, and not today.

 

Thanks

K.

6 REPLIES 6
eric-cheng
Solution Sage
Solution Sage

Hi @Kosenurm ,

 

Ensure your date format is in yyyy-MM-dd.  To do this use:

 

@formatDateTime(triggerBody()['GetDateValue'],'yyyy-MM-dd')

 

You can then either hardcode or use the Date Time connector to add 9 hours for 9AM.

 

Screenshot_20210925-235321_Chrome.jpg

Screenshot_20210925-235257_Chrome.jpg

--------------------------------------------------------------------------
If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up

Connect on LinkedIn

Thanks, in the expression you have given, how would I hardcode 9am... would it be...

 

@formatDateTime(triggerBody()['GetDateValue'],'yyyy-MM-dd')T09:00:00

 

?

 

Thanks

K

Hi @Kosenurm ,

 

@concat(formatDateTime(triggerBody()['GetDateValue'],'yyyy-MM-dd'),'T09:00:00')

--------------------------------------------------------------------------
If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up

Connect on LinkedIn

Thanks, but I am getting this error...

 

'In function 'formatDateTime', the value provided for date time string '25/09/2021' was not valid. The datetime string must match ISO 8601 format.'.

 

Any ideas?


Thanks

K

eric-cheng
Solution Sage
Solution Sage

Hi  @Kosenurm ,

 

You will need to change the format from dd/MM/yyyy manually

 

Easiest way is to use split().  See below.  

 

@split('25/09/2021','/')
 
@concat(outputs('Compose')[2],'-',outputs('Compose')[1],'-',outputs('Compose')[0],'T09:00:00')

 

Note: you no longer need formatDateTime()

 

Screenshot_20210926-025938_Chrome.jpg

 

Screenshot_20210926-030016_Chrome.jpg

 

 --------------------------------------------------------------------------
If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up

Connect on LinkedIn

 

Thanks. How can I use the original GetDateValue here, rather than a static 25/09/2021?

 

K.

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.

Top Solution Authors
Users online (2,534)