I would like to be able to control multiple unique button actions from one single control table.
Each button should take the formula or condition from the next column allowing easy unlimited configuration of button actions.
Hi @Andy_B this sounds like a great idea! It would be helpful to see an example - its great that you shared your doc however the permissions donāt allow us to see it. Please make it public with edit access so we can take a stab and better understand what you are trying to do.
Hi @Andy_B
Can i ask you why you have decided to have those button on a table instead of having then in the canvas, maybe in a dedicated page? (This not having seen your doc yet, itās locked!)
If that is impossible for x reason, you can ābuildā column buttons to read thisrow.other column (that change row by row) so it should not be a problem to do that, also, in extreme case, missing better option, you can always build an āif buttonā like if this is this so do that, if not do this instead, eccā¦
Iāll wait the doc to understand better your case
Heres a link to the example doc.
https://coda.io/@outsourcedigital/row-unique-buttons
Hi Mario, heres a link to the example doc and you can see the question page which I think should answer your question.
https://coda.io/@outsourcedigital/row-unique-buttons
OK this was fun to think about. My strategy involves to create independent canvas buttons that each represent the actions you want to customize/chain together.
Create a table a list/array of the buttons, with each row holding the button respective to the row position; row 1 represents button position 1 in the array, row 2 : button 2, etc.
Then create a control table, the human interface, where a multiselect lookup column allows us to choose the button/rows that we want; each representing the actions to chain together and run. The user (multi) selects the rows / actions.
In this example each button is named A,B,Cā¦ and opens its respective wikipedia article. The last button in Interface [Open A,C]
is the proof of concept; pressing it opens both articles in separate windows.
You can now change the formulas for the respective buttons to add, modify, delete rows and other Coda actions.
Hi @Andy_B, thanks for sharing the doc
Notes: as @Johg_Ananda have already posted a nice solution (good looking, probably well made and working fine, i havenāt tested it ) i will not re-start with the explanation but instead iāll take Johg steps and comment them
We can divide the solution in 3 steps:
- having all the button that you need placed and working!
this means that you have to set up all the buttons that later you will be āpressingā in all the table where they are needed.
(p.s. be careful with button use regarding ācoda best practiceā done by the amazing @Paul_Danyliuk, they can be really heavyweight in the final doc! more info here:
-
create a dashboard page where you place all the needed buttons, the one that will RunActions to press the other made in the 1) point (this can be achieved both with canvas buttons or with table buttons, chose your preferred one )
-
Configure and test your button to work properly
this in the longer part obv, and based on your shared doc i can see that you have already a basic understanding in how RunActions works, just let me share my way
Your current way of setting up buttons:
What you are telling coda here itās
āPress ALL the buttons that are in the table āTEST TABLE BTN 1ā, the one in the column BTNā
My proposed way is this one:
What iām saying here is similar but with more freedom
āPress ALL the buttons that are in the table āTEST TABLE BTN 1ā and satisfy the given filter (in this case a stupid checkbox check).the one in the column BTNā
If you want you could have also other button column to recall, to create more peculiar setups
In the same formula you can play as you like with various conditional āif()ā or retrive data in a give table/cell to modify the output of the actions, and blablabla
More info here:
hope that helps, update us on your progess!!!
Hey @Andy_B,
I havenāt read the replies closely, but I agree that most likely you need to approach your requirement differently. You can always have an SwitchIf()
statement that would press different buttons based on different column value, and that would probably be the safest option.
For answer completeness sake though, itās possible to dynamically specify button code using some black magic and deep control object modification:
As you can see though, the ācompiledā action code is a bit different from the formula language, so you cannot just use the code you normally type.
This is not an encouraged solution though!