Create an Interactive To Do List

I would like to create an interactive Weekly To Do List that would change depending on the days I'm working and what tasks I need to complete. These are the parts of the snippet I have been able to create so far:

  • I created a table where it conditionally shows the row of the days I am working based on a drop-down menu.

  • I created another drop-down menu with my list of tasks.

  • I used the "join" formula to show only the tasks that I check off from the 'Tasks' drop-down menu.

Days Working This Week: {formmenu: Monday; Tuesday; Wednesday; Thursday; Friday; name=Weekday; multiple=yes}
Tasks to complete: {formmenu: Task #1; Task #2; Task #3; Task #4; Task #5; Task #6; Task #7; Task #8; name=Tasks; multiple=yes}

This is supposed to be a table:
{if: contains(weekday, "Monday")}Monday {=join(tasks,"\n")}{endif}
{if: contains(weekday, "Tuesday")}Tuesday {endif}
{if: contains(weekday, "Wednesday")}Wednesday {endif}
{if: contains(weekday, "Thursday")}Thursday {endif}
{if: contains(weekday, "Friday")}Friday {endif}

I am stuck on how to create the next step. What I would like my next step to be is:

  • Once I choose from my 'Tasks' drop-down menu the number of tasks I still need to complete, the snippet will evenly as possible distribute the tasks with the number of days I am working that week. For example, if I am working 5 days and I have 5 tasks, it lists 1 task per day. If I am working 2 days and I have 5 tasks, it lists 3 tasks on the first day and 2 on the second, etc. Is this possible?

I will include a picture below of what my table currently looks like and what I would want it to look like.

To Do List

This was tough... How about this:

Wow! I never would have been able to figure this out! This was way over what I know how to do. Thank you so much @Dan_Barak1 I will unpack and go through this and reach back out if I have any problems understanding the formula. One question, if I want to add more tasks later on, would that be possible, or is the formula created specific to 7 tasks?

It should work with any number of tasks. I suggest using Data Blaze for your list of tasks. Let me know if you need help setting this up.

Yes, I just tried to add an extra task and it works perfectly! This is amazing. I wish I could use DataBlaze, but my company is not allowing it at the moment.

Would it be possible to add a date? I know, I'm asking for a lot. For example, If I wanted to create my to-do list for the following week.

I originally had thought of something like this:

To Do List3

Week of: {formdate: MM/DD/YYYY; name=Week Of}

{time: MM-DD-YYYY; at={=`week of`}; shift=>WED}

However, I was adding the date to each row, but with the way you set up the table, I don't see how to do that.

Hi Jennifer,
Are you looking for something like this?

Days Working This Week: {formmenu: Monday; default=Tuesday; default=Wednesday; Thursday; Friday; name=Weekday; multiple=yes}
Tasks to complete: {formmenu: Task #1; Task #2; default=Task #3; default=Task #4; Task #5; Task #6; Task #7; Task #8; name=Tasks; multiple=yes}
Week of: {formdate: MM/DD/YYYY; name=Week Of}
{`start of week`={time: MM/DD/YYYY; at={=`week of`}; shift=<MON}}
{ndays=count(weekday)}{ntasks=count(tasks)}{if: ndays>0 AND ntasks>0}{`min tasks per day`=floor(ntasks/ndays)}{reminder={=remainder(ntasks, ndays)}}{`tasks per day`=map([`min tasks per day` for x in seq(1,ndays)], (v, i)-> v + 1 if i <= reminder else v)}{indexes=merge([0],[sum(slice(`tasks per day`, 1, n)) for n in seq(1, ndays)])}{`daily tasks`=[slice(tasks, indexes[n]+1, indexes[n+1]) for n in seq(1,ndays)]}{`task list`=[weekday[n]:`daily tasks`[n] for n in seq(1,ndays)]}
{note: trim=left}{endnote}

Day Tasks
{repeat: for day in keys(`task list`)}{=day}
{time: MM-DD-YYYY; at={=`start of week`}; shift={=">" & LEFT(UPPER(day), 3)}}
{=join(`task list`[day],"\n")}{endrepeat}

{endif}

  • I used {`start of week`={time: MM/DD/YYYY; at={=`week of`}; shift=<MON}} to calculate the monday of the week from the selected date. You might want to change it toSUN, based on your comfort.
    Then based on the selection, kept moving forward to the date.

  • I used LEFT(UPPER(day), 3) to convert the day selected into first three letter characters word with case upper.

  • {time: MM-DD-YYYY; at={=`start of week`}; shift={=">" & LEFT(UPPER(day), 3)}} will display the date you want based on the day.

Thank you so much @vinoisg!!!

1 Like