Hi there, I just got started with Coda and love it!
I was wondering: is it possible to fill a canvas with content conditionally, based on another column?
Here’s what I want to achieve:
When creating a new meeting, I want to be able to select what kind of meeting it is. Eg. ‘Onboarding’ or ‘Sprint review’.
Then, based on the value in this column, I want to populate a canvas in the same row with a template that contains the relevant meeting items.
Is this possible? Or is there a better way to do what I’m trying to achieve?
From the suggestion @Quentin_Morel made earlier, the selection of the template is not done in the button …
The button on the canvas just adds a row to the table and when the row is added, depending on the value in the canvas select list, the template is chosen within the canvas column using SwitchIf() in Value for new rows where you should be able to select the appropriate templated page
Note that, even in the Value for new rows formula editor in the canvas column, it is not that easy to write a formula using multiple pages … I had to first select all the pages I wanted to use in the SwitchIf() and then write the formula around …
In this case, the button adds a row and adds the appropriate meeting type to the Meeting lookup field which is then used by the Value for new rows formula editor in the canvas column to select the appropriated page
Thanks for your answer! This time it finally did click and I was able to select the pages. Somehow, before, I had a lot of trouble getting the normal pages (instead of tables) to show up in my function options.
No problem @Freerk_Lap !
I honestly didn’t do much here , just added a detail or two to the thoughtful suggestion of @Quentin_Morel .
I’m glad to know it helped you to solve your issue .
As far as I know, you can’t reference (sub)page(s) (using something like @Name_of_the_(sub)page) anywhere else than on the canvas (in the content of a canvas column included) or in a text field … both would return the link to the referenced (sub)page(s) … (i.e.: (sub)page(s) can’t be used formulaically)
I think the only exception to this is the Value for new rows formula in a canvas column using the suggestions Coda gives us …
I could be wrong though (It’s been a while since I’ve played around with (sub)page(s) ) but this would explain why you could select (sub)page(s) for the canvas column but not in your button
Depending on the use case, there could also be workarounds involving the url of the (sub)page(s) but that’s another story