Automatic Scheduling of Todos


#1

I’m trying to create a system that will automatically schedule my tasks based on the date of the event and things that need to get done based on that date. For example, given we have a meet coming up on [date], I know I need to book airfare x days in advance, submit our entries y days in advance, and send out results to the team z days after the event. I have tried to use FormulaMap(), however it doesn’t seem to let me fill out all the columns. I am probably just using it incorrectly, but does anyone have any advice on how to accomplish this?

Here is what I have so far, however CurrentValue.Task does not seem to work and throws an exception.

Configurations.FormulaMap(AddOrModifyRows(Tasks,true,Title,thisRow.Title,Type,thisRow.Type,Program,thisRow.Program,Tasks.Task,CurrentValue.Task))



Thank you in advance!


#2

Hi @Austin_White,

If you publish a Coda doc as an example of this, instead of pictures, I can copy the doc and write the formulas for you. With just the pictures, we have to manually create a dataset to test our implementation on.

My best guess is two new entries in the FormulaMap():
, Due, Today() + thisRow.Days))

Thanks in advance for sharing,
Lloyd


#3

https://coda.io/d/World-Elite_dtcSeCA96m0/_susS0.

Hi Lloyd,

Thank you for your response. I too tried adding multiple entries for the additional entries. That works, and I won’t have trouble with the actual date calculation. However, I think the problem is my understanding of the FormulaMap() function. I’m trying to use it like a foreach() loop, assuming CurrentValue as the row in the Configurations table that is being looped over. Is my assumption incorrect?

Thank you,
Austin


#4

Hi @Austin_White,

The FormulaMap function is confusing if you already have a conceptualization of programming. Accessing the different contexts such as thisRow and CurrentValue are not consistent. The Coda developers have a very difficult problem of handling data types across a system that doesn’t have strict-typing (appropriately so). Therefore, questions such as “what contexts does this function have access to” and “how do I explicitly access certain variables” are not always clear.

My best advice is to simply try typing the name of the variable you think you should have access to, and see what the formula building brings up! Use the colour-coding to understand which context the variable is from.

See the following clip to understand how the colours match up:

In fact, you have the variable name “Type” in all three of the available contexts in the formula: Schedule, Tasks, and Configurations. For this reason, the formula builder is showing three different "Type"s. This is normally a sign that perhaps you have duplicate information that could be trimmed down:

For this reason, I end up muttering things like “Into purple, from green” over and over as I write my formulas. This helps to remind myself that (unlike in traditional programming), the color of the variables matters, and is helpful to understand.

Here is a screenshot of your formula the (hopefully) correct results:

And your complete formula:
Configurations.FormulaMap(AddRow(Tasks,Title,Title,Type,Type,Program,Program,Task,Task,Due,[Start Date]+Days))

PS - You were using AddOrModifyRows() before, and I changed it to an AddRows(). Is there a reason you wanted to use the potential “modify” part?

Lloyd


#5

@Lloyd_Montgomery

I continue to run into this scenario. Despite all my experimenting, I have thus far been unable to deduce the rules that actually govern this. Some official clarification on the matter would be welcome! :smiley:


#6

Hi @Ander,

I absolutely agree. Not only further documentation, but I believe the Coda team needs to agree on specific keywords to access certain contexts. For example, CurrentValue appears to be only half implemented, leaving a lot to be desired. Things like CurrentValue.RowId() do not work, even if CurrentValue is a row.

Lloyd