I am hoping someone can help!
I have a list which handles 'Bookings'. Single day bookings can be placed by selecting the 'Booked - Single' option from a drop-down field which then allows the user to set a start date & this adds an item to that users availability list with their name & the date they are booked out.
There is also an option from the drop-down list 'Booked - Ongoing' which allows for an 'End Date & Time' field & 'Days' fields to appear. The user will select the date which the booking starts and the end date for the booking.
I have a need for a flow which takes everyday between the 2 dates and updates the users availability list with an item for each date so if I filter their availability down to a date between those 2 dates it shows they are booked on that date.
However... Frequently, it isn't every Monday - Friday between the 2 dates. On many occasions it can be just the Monday, Wednesday & Friday of each week between the two dates. Which is why I have created a 'days' multi-choice field which the user can select which days between the two dates are to be booked specifically keeping the other dates open.
Example:
New item:
Type: Booked - Ongoing
Start: 21/11/2019
End: 07/04/2020
Days: Monday
Wednesday
Friday
Flow - Gather what days have been selected by the user, gather the start and end date, create list items for every date which falls upon the specified days between the gathered dates including the current date if that is one of the selected days.
Can anyone please assist with how I could achieve this?
Thank you!
Solved! Go to Solution.
Hi @ESSteven,
You can set the conditions to check the specific days by using the dayOfWeek() function, if it is 1 or 3 or 5 (Monday or Wednesday or Friday), create the item.
Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @ESSteven,
You can initialize two string variables to store Start Date and End Date.
Then Initialize a number variables to init the increase days, set its default value is 0.
And you want to create items according to the date, the addDays() function would help you:
addDays(variable('StartDate'),variable('Days'))
However, we need to stop it if the result of addDays is greater than the End Date.
So, we need to create a Do Until action to put the condition into it to make the create item keep going until End Date.
Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@v-litu-msft ,
Thank you for your answer.
This works perfectly for a 'Block Booking' from one date to the next covering every day in between.
However I was looking for a solution which would allow for the selection of specific days (Monday, Wednesday & Friday) and for the same flow as you have given to run however only the Mondays, Wednesdays & Fridays in between the start & end date are created as new items.
Any ideas?
Hi @ESSteven,
You can set the conditions to check the specific days by using the dayOfWeek() function, if it is 1 or 3 or 5 (Monday or Wednesday or Friday), create the item.
Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.
Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!
User | Count |
---|---|
46 | |
43 | |
36 | |
35 | |
25 |
User | Count |
---|---|
48 | |
38 | |
33 | |
33 | |
31 |