Button Function Implementation

I know the Button() function is listed as experimental, but I was curious if there is an example of how it is currently intended to be used?

I tried referencing a column with buttons in it, and that did not seem to work. And whenever I try to use the function as a standalone formula (e.g. =Button(foo)), I keep getting the error: Source must be a RowColumnReference.

Thanks in advance for any insight.

1 Like

Hi Joseph

Can you help describe the scenario where you were trying to use the Button formula and how you would imagine this formula to fit in?

The Button function is not yet ready to be used as a standalone formula, which is why we don’t have examples for it. At the moment the only way to create and use buttons is to format a column as a Button, or to use the plus icon to insert a button on a Section.

If and when we end up exposing these formulas as standalone formula, we will definitely update you and the community.

Thanks
Himanshu

1 Like

Thanks for the clarification. I wasn’t sure how functional the Button formula was intended to be at this time.

I had been attempting to use the Button formula in an IF statement, both in a table and as a standalone formula. The idea was to show a Button if the IF condition was True.

OK. Thanks for sharing the scenario.

At the moment there is no way to conditionally show the button, however, you should be able to apply the button format and use the “Disabled” field to specify a formula that when true will disable to button. That way the Button will look different visually.

1 Like

No problem. And yes, that is one of the go-to workarounds.

Related, if I may - is it possible to use a control button to push just one button/row in a button-formatted column? i.e. If I have a button outside of a table, and I want to use it to press just one button in a table (not every button in the column of a table), can I do that? This was the related issue that led to me coming across the Button formula.

At the moment there is no way to do it assuming buttons in multiple rows are enabled on the table. I am assuming that is the case in your scenario. We are exploring options for enabling these type of scenarios.

If however, you are able to change the Disabled option for the button formatted column and set it to a formula that disables buttons for all rows but one, then you can press the buttons in the entire column, but only the enabled button on the single row will run. I am assuming this is not possible in your scenario.

1 Like

Can you elaborate more on the scenario where you would want to click a button on a single row from a button control on the section? How is your control setup, and how do you want to specify the row whose button should be clicked?

Happy to elaborate.

I’m currently building a quasi-front end for an “app” in Coda. In this case, users would be directed to a specific section where only buttons specific to them would appear. In another section would be a table containing a button column. For example, the table may look like this:

And the “front end” section may look like this:

image

As you may have surmised, the IncreaseQuantityButton increases the quantity in the respective row, and the PurchaseDateButton resets the Date of Last Purchase Column to Now(). The MasterButton presses both button in the row, and performs as desired - only the buttons in the specific row are pressed.

I am trying to avoid having a table in the “front end” section. The buttons in the frontend section - ideally - would press the MasterButton in the corresponding row. e.g. The Bought a :hammer: button would only press the MasterButton in the Hammer row.

There are certainly workarounds, and I have included some below:

  1. I can create a table view of the MasterButton column and filter out rows that are not needed. This is not something I love since it creates an additional vector from which the table can be modified.

  2. I create a separate table for each item. This is possible, but adds a lot of extra manual work and clutter.

  3. I have the control buttons do what the buttons in the column are doing. This again is possible, but like #2, creates significantly more manual work and potential for error.

While this hypothetical use case does not exactly reflect my potential use case, the barriers are the same. It would not always be possible/practical to disable the buttons that I do not want pressed. I realize some of these issues are tangential to a granular permission system, and that Coda is still in beta (albeit, an impressive beta). I also want to make clear that I really enjoy Coda, and I appreciate you taking the time to discuss.

1 Like

Thanks for the details. This is very helpful. You are right at the moment this doesn’t have a direct solution. The workarounds you listed would work but as you suggested they all have some downside.

And thanks for taking the time to share your feedback. Please keep it coming and I am glad you are enjoying using Coda!

1 Like