Is it normal that a button with an if()-statement is greyed out if one part of the if()-statement trows an error?

I built a button that clones a task (=creates a copy) on the next date. I tried to use if() to build a formula to make sure that if the task was itself a clone, the new clone would be based on information from the parent task through a lookup column.

However, all buttons in the table are greyed out if there is no information in the lookup column. It seems to me as if the button evaluates both the code in both the true and false part of my if()-statement before executing, which causes an error and the button greys out.

Is this normal for If()? Or is caused by inner workings of the button?

I solved this by creating a separate button to run the formula that creates a copy of a clone.
You can find my doc here: Week planning Kanban board.

As far as I know in coda if() statement works in a way that you have to have both True and False part of the statement, you can have just True. Its not connected to button logic itself but as how IF is implemented in Coda-a (unless they changed something recently).
You could try to use SwitchIF as a replacement for your use case it might work, but I cant log into Coda-a at the moment so couldn’t open your doc to see what exact use case it is

Thanks, that explains it. Unfortunately, Switchif() does not solve the problem.

I managed to get some time and take a look at your doc. I think I managed to find where the problem is.
Your Clone Parent Column was formatted wrongly. It was number type while it should be formatted like this:

Than your buttons should work correctly.
Problem was you were trying to get this:
Untitled picture 2

But number column cant have .task or .anyothercolumn, you need to have lookup for that. Once you change it to lookup and connect to this same table it works :slight_smile: Coda even underline it with red where the problem is , you just didn’t pay attention to type of formatting of Clone Parent Column :slight_smile:

1 Like

Oh, amazing. Thanks @Marko_Petrovic!