Hi Sarah!
Ok so I have finally sorted it out!
Here is the finished formula (hopefully )
switchif(
thisRow.Type = Task AND thisRow.Recurrance.IsBlank(),
RunActions(
ModifyRows(thisRow, thisRow.[Task Status], Complete)
),
thisRow.Type = Task AND thisRow.Recurrance.IsNotBlank(),
RunActions(
AddRow(
Tasks,
Tasks.Task,
thisRow.Task,
Tasks.[Do Date],
thisRow.[Next Due Date],
Tasks.Recurrance,
thisRow.Recurrance,
Tasks.[Task Status],
Incomplete,
thisRow.Type,
thisRow.Type,
thisRow.Level,
thisRow.Level,
thisRow.Notes,
thisRow.Notes,
thisRow.Priority,
thisRow.Priority,
thisRow.[Habit Routine],
thisRow.[Habit Routine],
thisRow.[Habit Status],
thisRow.[Habit Status]
),
ModifyRows(thisRow, thisRow.[Task Status], Complete)
),
thisRow.Type = Habit AND thisRow.[Habit Status] = Active,
RunActions(
AddRow(
Tasks,
Tasks.Task,
thisRow.Task,
Tasks.[Do Date],
thisRow.[Next Due Date],
Tasks.Recurrance,
thisRow.Recurrance,
Tasks.[Task Status],
Incomplete,
thisRow.Type,
thisRow.Type,
thisRow.Level,
thisRow.Level,
thisRow.Notes,
thisRow.Notes,
thisRow.Priority,
thisRow.Priority,
thisRow.[Habit Routine],
thisRow.[Habit Routine],
thisRow.[Habit Status],
thisRow.[Habit Status]
),
ModifyRows(thisRow, thisRow.[Task Status], Complete)
),
thisRow.[Habit Status] = Bonus AND thisRow.Type = Habit,
RunActions(
AddRow(
Tasks,
Tasks.Task,
thisRow.Task,
thisRow.Recurrance,
thisRow.Recurrance,
thisRow.[Task Status],
Incomplete,
thisRow.Type,
thisRow.Type,
thisRow.Level,
thisRow.Level,
thisRow.Notes,
thisRow.Notes,
thisRow.Priority,
thisRow.Priority,
thisRow.[Habit Routine],
thisRow.[Habit Routine],
thisRow.[Habit Status],
thisRow.[Habit Status]
),
ModifyRows(thisRow, thisRow.[Do Date],
Today(),thisRow.[Task Status], Complete)
)
)
Essentially what I did is…
- I realised that my SwitchIf’s for the Habit status were not logical (they did not cover all options for the variables in the argument e.g. like in the Task arguments at the beginning of the formula - In the Tasks arguments I covered both IsBLank and IsNotBlank. So I changed the first Habit argument by removing the IsBlank argument and instead just made it Status: Active and Type: Habit.
- And then I made the final argument - Status: Bonus and Type: Habit (this covered all options as explained in Step 1).
- Finally I retried the Now() function on the final argument in the ModifyRows final line and IT WORKED!