cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
crirojsab
Frequent Visitor

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
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (950)