Disable Button in Table 1 Based on User Specific Info in Table 2

Hi, Coda Community!

I’ve had one of those wall-hitting moments where I needed to just call it and reach out.

I have two tables. Table 1 has a series of buttons that when clicked, log your action in Table 2. In response, I’d like to disable the button in Table 1 if you appear in the log of Table 2.

You can see in the image above, I appear alongside two of the ERGs so I’d like the button to be disabled on those two rows, and still available on the rest.

Here’s what I need it to look at:

Does ERG Requests Table.ERG = thisrow.ERG?
if yes…
Does ERG Requests Table.Name = User()?

Here’s the playground doc: Playground Doc

Hey @Sara_Jean_Kwapien,

You haven’t shared the doc but here’s the simplest solution:

On the button set Disable If formula like

[ERG Requests Table].Filter(
  CurrentValue.ERG = thisRow
  AND CurrentValue.Name = User()
).IsNotBlank()

This is the most straightforward solution but not the most performant one. However if you don’t expect the tables to grow to thousands of rows (or until you do so) this should do.

Important thing to understand:

On table ERG Requests Table, ERG column is a Lookup column, which means the values there are row references, not just text labels. Hence you don’t compare that to thisRow.ERG (a text value) but to the whole thisRow itself.

1 Like

Oh, man - thank you, Paul! Also, ty for noting I didn’t share the doc - I need to figure out how to get that to work, lol.

This worked beautifully!

Hi Sara Jean! Great to see you building on Coda and big thanks to Paul for helping solve the button question and providing some good tips about Lookup columns!!

I am part of Coda’s Success Team and here to help with doc builds and optimization and even doc sharing (per your note). If you ever want to set up some time to walk through a doc, let me know!

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.