cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Puktomi
New Member

Create event at 8am one day before another created event

Hello,

 

I'm new to Power Automate, but it seems like it might solve a problem for me: creating an event at 8am one day before another manually created event's start time

 

Requirements:

When user creates calendar event "A", then create event "B" one day before that starts at 8:00AM and ends at 10:00AM.

 

The problem with event "A", is that ideally, it's Start Time can be scheduled at anytime, so simply using

addDays(triggerBody()?['start'], -1) or addHours(triggerBody()?['start'], -'x') doesn't really help if the Start Time for "A" could be at any time on the start date. I can create event B on the right day, but not at the right time. It also won't be created at a consistent time, so neither Start or Created Times seems to help.
 
Is there another method I can use preset or specify a start time at 8:00AM (perhaps some variable?), and then use addDays() to change the date?
 
Hoping for some help or to be pointed in the right direction, as I'm struggling to be able to create an event at a specific date and time in relation to another event which was created. Appreciate any ideas ahead of time. Here is what I've got so far:

Capture.PNG
 
2 ACCEPTED SOLUTIONS

Accepted Solutions

Hi @Puktomi 

I asked you to use the code to specify the datetime for the 'Event B'. By using the code with the timezones, you will be able to create an Event for B on 8 AM.

 

Hope it helps, please like it or mark it as a solution if it resolves ur clarification or issue
-Sudharsan K...

Hope it helps, please like it or mark it as a solution if it resolves your clarification or issue
-Sudharsan K...

View solution in original post

@sudharsan1985 

 

Sorry, I did not understand that I could change the last 'HH:mm' to a value that I wanted. I was under the impression that I could only change the order of the format. 

 

On my last reply, this is what I tried.

convertTimeZone(addDays(triggerBody()?['start'], -1),'UTC','Mountain Standard Time', 'MM/dd/yyyy HH:mm')

 

But now, this is what I tried, and it worked:

convertTimeZone(addDays(triggerBody()?['start'], -1),'UTC','Mountain Standard Time', 'MM/dd/yyyy 08:00')

 

Thanks for setting me straight.

View solution in original post

4 REPLIES 4
sudharsan1985
Super User
Super User

Hi @Puktomi 

Can you please try to use the below condition to set the date and time

convertTimeZone(addDays(triggerBody()?['start'], -1),'UTC','W. Europe Standard Time','dd/MM/yyyy HH:mm')

Refer this post too https://powerusers.microsoft.com/t5/General-Power-Automate/Formatting-Date-And-time-in-MS-Flow/td-p/... 

 

Hope it helps, please like it or mark it as a solution if it resolves ur clarification or issue
-Sudharsan K...

Hope it helps, please like it or mark it as a solution if it resolves your clarification or issue
-Sudharsan K...

Hello @sudharsan1985 

 

Thanks for your time. While converting the timezone is necessary for this project and was not yet implemented, it does not resolve the issue I created this post for.

 

The goal is to have "Event B"  created at 8am one day before "Event A" was created, regardless of the Start Time of "Event A". Please see the resulting screenshot to see the issue.

Capture2.PNG

Whether the "Event A" was made with a Start Time of "8:00am" or "2:00pm", or any other time for that matter, I need "Event B" to start at 8:00AM. In the picture above, the date of the 12th, should have the Event "B minus one" to start at 8:00AM. Currently, it is starting exactly 24 hours before "Event A" was set to start.

 

Thanks!

Hi @Puktomi 

I asked you to use the code to specify the datetime for the 'Event B'. By using the code with the timezones, you will be able to create an Event for B on 8 AM.

 

Hope it helps, please like it or mark it as a solution if it resolves ur clarification or issue
-Sudharsan K...

Hope it helps, please like it or mark it as a solution if it resolves your clarification or issue
-Sudharsan K...

View solution in original post

@sudharsan1985 

 

Sorry, I did not understand that I could change the last 'HH:mm' to a value that I wanted. I was under the impression that I could only change the order of the format. 

 

On my last reply, this is what I tried.

convertTimeZone(addDays(triggerBody()?['start'], -1),'UTC','Mountain Standard Time', 'MM/dd/yyyy HH:mm')

 

But now, this is what I tried, and it worked:

convertTimeZone(addDays(triggerBody()?['start'], -1),'UTC','Mountain Standard Time', 'MM/dd/yyyy 08:00')

 

Thanks for setting me straight.

View solution in original post

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

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

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

Users online (20,697)