Hello,
I have a booking system which gives a patient dates to visit a clinic. How it works, we pick "start day" a to that date I am adding days using this "addDays(triggerBody()?['...here is start date...'],7)", and it creates a "visit" in calendar, after that there is another action same like that before but with different number, like that "
Solved! Go to Solution.
Hi @Dowre,
It seems that you would like to create an event only on workday.
Please check the following flow for a reference.
Trigger the flow by a button. Select a Text input and a Date input.
Add the action Create event. Input the following code in the Start time and End time field:
if(equals(dayOfWeek(addDays(triggerBody()['date'],7)),6),addDays(triggerBody()['date'],9), if(equals(dayOfWeek(addDays(triggerBody()['date'],7)),0),addDays(triggerBody()['date'],8),addDays(triggerBody()['date'],7)))
Above function will check if the day of week is equal to 6 or 0, if yes, add corresponding dates on the initial date, if no, use the initial date as the start or end date.
Please check it for a reference and try it on your side.
Reference doc on dayofWeek function:
Best regards,
Mabel
Hi @Dowre,
It seems that you would like to create an event only on workday.
Please check the following flow for a reference.
Trigger the flow by a button. Select a Text input and a Date input.
Add the action Create event. Input the following code in the Start time and End time field:
if(equals(dayOfWeek(addDays(triggerBody()['date'],7)),6),addDays(triggerBody()['date'],9), if(equals(dayOfWeek(addDays(triggerBody()['date'],7)),0),addDays(triggerBody()['date'],8),addDays(triggerBody()['date'],7)))
Above function will check if the day of week is equal to 6 or 0, if yes, add corresponding dates on the initial date, if no, use the initial date as the start or end date.
Please check it for a reference and try it on your side.
Reference doc on dayofWeek function:
Best regards,
Mabel
Hi @v-yamao-msft!
Thank you for your solution, I tried to implement it to my flow and it works great!
I would like to use your Idea but adding a number of days but I did not get this to work Could you please help me out with this
Thanks in advanced @v-yamao-msft
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Announcing a new way to share your feedback with the Power Automate Team.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
User | Count |
---|---|
72 | |
27 | |
22 | |
15 | |
13 |
User | Count |
---|---|
141 | |
42 | |
42 | |
34 | |
30 |