
I'm setting up a flow that reads an excel table, then creating a task for each entry in the table.
The table looks like this:
Bucket Name | Task Name | Progress | Priority | Assigned To | Created By | Day of week | Start Time | Due Time | Description |
Daily Tasks | Daily Task 1 - Monday | Not started | Medium | 1 | 9.00 | 12.00 | 1st Daily Task added by Excel |
The schedule is planned to start on a Sunday at 4am. The Day of the week, 1 is Monday, 2 is Tuesday, etc.
When the (planner) 'create a task' step runs the start / due uses the following expression to set up the correct day:
addDays(utcNow(),int(items('Apply_to_each')?['Day of week']))
I then update the description after a delay, then using the 'Update a task (V2)' want to add in the 'timings' so the tasks appear in the correct order for the day:
addHours(body('create_a_task')?['startDateTime'],int(items('Apply_to_each')?['Start Time']))
and
addHours(body('create_a_task')?['dueDateTime'],int(items('Apply_to_each')?['Due Time']))
This works... sort of!
As the tasks are scheduled to run at 4am the timings run from when the actual task is created, so some the tasks for later in the day are running over to the following day.
When I create the initial start / due dates how can I force it to 00:00?
I'm going to be running similar flows for a variety of teams / planners and want to stagger when the run.
Also in planner and when you view it in Outlook as a linked iCalendar can the tasks be seen across there times, not as an 'all day' task?
Hello @Anonymous
As I understood, you need to remove the time from some date fields. You can do it using the following expression:
addDays(utcNow(),int(items('Apply_to_each')?['Day of week']),'yyyy-MM-dd')
On the other hand, if a planner task starts in one day and finishes on another different one, you will see the event as a full day one in Outlook/iCal.
Hope it helps!
Ferran