At its core I’m attempting to render a list of buttons from a formula given some list. Right now, I have a table with a column of type button, and elsewhere on the page I want to render those buttons on the page through a formula.
I’ve iterated through different formulas, looked into the hidden Button() function but haven’t been able to find a solution
Here’s what I expect to work:
[Table].FormulaMap(CurrentValue.ButtonColumn)
All this gets me is a comma separated list of ⚡️ Action.
I’m starting to think that this isn’t possible, currently, on Coda.
The hidden Button() formula to the rescue but you have to use it in a separate column on your table, then concatenate the values from that column.
In your table, set up your button (let it be a column called ButtonColumn)
Add a column of default Text type (let it be called ButtonFormulaColumn) and make it a formula:
Button(thisRow.ButtonColumn, "My Label")
Now in your page or anywhere in the doc, do the:
Table.ButtonFormulaColumn.Concatenate()
to render those buttons inline.
To add spaces between buttons, add .Concatenate(" ")to the Button() formula on step 2. You can also try adding .Trim() to the formula on the step 3 to eliminate the trailing space but I’m not sure from my memory whether that will work. Using Join(" ") instead of these may not work.
Really curious as to why this extra column w/ the .Concatenate() call is needed. As opposed to, just on the page, Table.ButtonColumn.FormulaMap(Button(CurrentValue.ButtonColumn,"my label").Concatenate())