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
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

Users online (17,302)