Button Formula to hide a column

I’d like to push a button and have a column’s info disappear from view AND click it again to bring the info back.

Any ideas on the best way to do this?

1 Like

Hi there! Nice to e-meet you, my name is Maggie and I am part of the Coda Success Team. I would love to help out here.

My suggestion would be starting with adding a button in the row you want to modify and using our “ModifyRows()” formula. I like use an “If()” formula and checkbox to signal the different actions depending on what data is showing (aka if the column is clear or not).

Click here to set up some time to talk through this live! We can use the time to make sure this button is set up to function optimally and walk through any other builds you may have questions on.

Maggie

1 Like

Thanks for that info. But I’m looking to hide several rows at one time. Any way to change the font color to white or cover the whole cell with black?

The use case is a trivia game. The host needs access to the question and the answer but the players need to see the question without the answer.

Thanks in advance.

1 Like

Hey! You could define in another table or formula who the host is, and then conditionally hide or show any column data for players/hosts by using the user() formula to check if the current user() is the host.

There’s some other small caveats such as whether or not your players are in published mode but it can be done for sure!

If you share a dummy doc with a little more context as to what you are looking to do, I can help make it happen!

1 Like

How fun! Feel free to share your doc per Scott’s note below - in the meantime, here is an example doc of “unlocking” answers. Check it out for some additional inspiration!

1 Like

Following up on Scott’s note above, I’ve typically created a two fields - one with the actual value (eg in this case, the actual answer), and then a second field that is a formula with if statement to show either blank or the actual answer depending on if the user viewing is the host / lead / etc.

Here’s a toy example with your Trivia game (you’d replace the host_input with whoever the actual host is with an @ mention):

image

image

image

1 Like