Say I want to be able to update a certain groups of rows with a button. Let’s say I have a list of subtasks, and when the main task is “Complete”, I want to change the status of all related subtasks to “Complete” as well.
Normally, if coding something like this, I’d start out in MainTask-Table, find all rows in SubTask_Table with the right Related-MainTask-Name, go to the first row, update the SubTask-Status, then loop through all the other rows in the found set until I’m at the last row.
It looks like Coda has something similar with the FunctionMap function?
So if I have a button in the MainTask-Table that says “Mark SubTasks Complete”, how would I do that?
Is it possible to do this with a loop of buttons? Say, for example, I have a button that says “Mark SubTask Complete” in each row of the SubTask table. Then in the MainTasks table, have a button that automatically executes all the buttons in the related rows? Obviously, if there was a fixed number of buttons to push, I can just add in those buttons one at a time, but I don’t know how many subtasks there are for each main task.
It looks like you might be able to select all related fields, have a button in each one that says “MarkCompleted”, then execute all those buttons at once with RunActions. Is that right?
Never mind. Looks like the ModifyRows function will update all selected rows at once.
(But I’m still interested in learning how to use RunActions and FormulaMap, and look forward to examples being posted here to help me learn how they work.)
Provided a list and a formula, returns a list where each item is passed through the formula.
INPUTS
list
A table, column, or list of values.
expression
The formula to transform every value in list. Use currentValue to reference the current item being evaluated. For example, an expression of “currentValue * 2” will double every item in the list.
Sure, depends on your business logic, but that’s easy to implement. You would just need to decide if having no subtasks also means that your task is complete.