cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
crirojsab
Helper I
Helper I

Event Creation avoiding weekends

Hello:

 

I'm in the process of create several events as part of a flow creation. One of the sections what it does is create an event in 30 days taking as an start point the actual day. For this I'll be using the next expression.

 

adddays(formatDateTime(utcNow(),' yyyy-MM-ddT11:30'),30)
 
Until there all is fine.
 
However the questions is: How can I ensure that at the time of create the event in the user calendar this is no going to fall in a weekend day? There is any way of do this validation?  The same question applies for Weekly and Yearly event as those event creations with this frequency also are part of the Flow. 
1 ACCEPTED SOLUTION

Accepted Solutions
bradleyhorton
Resolver II
Resolver II

@crirojsab  if you use dayofweek('start time formula') then this will return a number between 0 (Sunday) and 6 (Saturday) and then you can adjust the number of days you are adding to the start time.

 

Might be easier to build in stages using Compose steps.

  • Add 30 days to UTCnow()
  • use Dayofweek to check if a weekend
  • If a weekend, amend the number of days being added (31/32 etc)
  • continue with the create event step

View solution in original post

3 REPLIES 3
leyburn19
Memorable Member
Memorable Member

Look at DayofWeek() DayOfMonth() etc

Hello I has been waiting more inputs as previous answer unfortunately not provide too much light. I'm aware of those functions. However the mainly question is:  There is a function that only provide as an output days that are between Monday and Friday at the time of Create An event and use it as an start date or any idea of how to do it? 

crirojsab_2-1618422221486.png

 

 

For example: How can I know if at the time of setup this event in the Start time field 30 days from know this one is not falling in a weekend? 

 

bradleyhorton
Resolver II
Resolver II

@crirojsab  if you use dayofweek('start time formula') then this will return a number between 0 (Sunday) and 6 (Saturday) and then you can adjust the number of days you are adding to the start time.

 

Might be easier to build in stages using Compose steps.

  • Add 30 days to UTCnow()
  • use Dayofweek to check if a weekend
  • If a weekend, amend the number of days being added (31/32 etc)
  • continue with the create event step

View solution in original post

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.

Users online (2,389)