
Announcements
Hello,
I have a resource planning solution and I'm now trying to build a functionality that allows the user to setup a workschedule to a user.
Through the Power App the user will select the days of the work he works (Monday, tuesday, wednesday, thursday or friday) and setup start and end time per day. This will feed a entry on a dataverse table with the correspondent structure:
Now I want to build a flow that when a entry is added on this list will be triggered and create entries on the activities table to setup the availability of the user.
So for example in this case I want the flow to create a entry for every monday between 13/05 and 25/07 on the activities table with start time 8:00 and end time 17:00. This is the way we are managing availability for other cases already and all the activity types.
Any idea how can I get like a list of every monday, tuesday, etc. between 2 dates on power automate to start?
Best,
Miguel
You might consider using a Do Until loop and 2 variables. Store the start date in one of the variables. Make the second variable a boolean and set it to false.
You will loop until the boolean variable is true
In the loop, evaluate the start date using a dayOfWeek expression.
Add they date to an array or take some other action if it one of the days in which you are interested.
Then add 1 day to the date
If the result is after the end date, set the variable to true.
If this doesn't make sense, let me know and I'll create an example.