I have a Tasks doc with a table view of tasks and buttons that control which view is selected. The buttons’ text dynamically change color based on whether their respective view is currently active.
So far, everything is working well, with the logic built into the buttons themselves. However, I’m now trying to extract some of that logic to make the setup more organized and scalable.
To do this, I created a Variables table where each button’s state is stored. When a button is clicked, it updates the value column to true while setting all other values to false, ensuring only one view is active at a time.
The Challenge
I need this button state behavior to be user-specific. In other words, if User A clicks the “Open” button, the variable Tasks Open View State should only be true for them. Meanwhile, User B may have a different button selected, without affecting User A’s selection.
Question
How can I structure my variables table or update logic so that each user sees their own button selection without affecting others?
If I’m understanding you right, I’d do a table where each row is a user, and each column is a variable. This was a common way to handle per-user filtering before Coda implemented the filter bar.
Your first column would be the User, and then you could either…
(1) have the second column be a select list, with options “Tasks Open”, “Tasks Overdue”, etc.
or,
(2) have a checkbox column for each of your variables
Then when you press a button, it would be something like ModifyRows(DB Variables.Filter(Person = User().TasksOverdueViewState, True)
As a bonus, you can actually expose a view of this table to the users if you want, as a piece of UI. For example, if you went with my option 1, you could show them only the select list column and nothing else, and filter the table to Person=User() so everyone only sees their own selection. The result looks like a single-cell table that is a dropdown select list.