Subtlety of "Disable if" in a button

Hi,
Coda Basics is definitely my category! :slight_smile:
So, to stick to the theme, why
• this work:
[button]“DISABLE IF”
thisRow.Category = “A”

• but this doesn’t work:
[button]“DISABLE IF”
thisRow.Category.IsBlank()

wait, wait, except that I have just discovered, by doing a last test just before posting this question, that if I pick manually “blank” in my “Category” Column Select list, the “DISABLE IF” works!
Which means that the problem is not in the formulation of “DISABLE IF”? :thinking:
(I am thinking while typing this post…)

Hi Gabriel,

Are you distinguishing between null (“”) , blank (" ") and initial? I do not know whether “initial” is a valid concept in Coda, but it refers to the contents of a field before anything has been assigned to it. Which is not the same as blank. Or null.

Regards
Piet

1 Like

Hi Piet,
thank you for your answer.
That’s just what I was wondering, a bit empirically!
When you say null (“”) , blank (" “), do you mean that null (”“) is equal to nothing, no item at all, and blank (” ") to an empty space?
I’m not sure I understand, and I feel like this is where my button problem lies:
If(thisRow.Category.IsNotBlank(), ’ ', ‘’)
As for “initial”, I don’t understand what it’s about. To me, initial means “first letter of a word”…

This still comes back to my main problem, I think, with Coda, which is, not (only!:wink: about understanding the formulas, but the correct syntax to make the elements of the formulas work. I feel there is a lack of this in tutorials, videos, various resources, etc. Especially when you are a real beginner in this field, and you discover this way of “programming” these elements: how to articulate and organize things correctly, and to understand the precise role of signs (., =, “”, “”, etc.)…
In short, the basic but universal syntax!

1 Like

In Coda blank (" ") means that cell you are referring to doesn’t have any value, nothing is selected (if its select list) or no text is entered (not even empty space) if its for example text field.
Basically cell that has " " as value will return True on .isblank() formula.

As for button disable, not sure what exactly is your setup, but formula thisRow.[Column name].IsBlank() definitely works for disabling buttons, I use it all the time. It will disable the button if that cell is empty.

Hi, thanks!
I just changed something a bit randomly in my button settings,
from


to

And now everything (including my DISABLE IF, which wasn’t the problem) works.
But i have to admit that i don’t get fully how that works about ’ ’ and ‘’ (or " " and “”)…

Hey @Gabriel ,
Forget the if() formula, just enter thisRow.category.IsBlank() in the disable if field and your button will disable if the category is empty.

And please make a dummy doc showing an example of your problem and share it, that makes is to much easier to troubleshoot your problem(s) and help you out with sample code.

Greetings, Joost

4 Likes

Wait you all.

There’s no special meaning of " " (a text with one space). It is NOT blank.

"" (an empty string, nothing between the quotes) — now that IS blank.

Are you saying you’re seeing a blank cell but it doesn’t match against the .IsBlank() function?
Then the cell is perhaps not really blank, and you need to examine that (and fix the root cause, not slap random duct tape formulas over it)

3 Likes

Hey @Paul_Danyliuk ,

Are you saying that my post (just above yours) is not correct? I think the “disable if” button option was not used correctly, all the other stuff is, as far as I can see, not relevant. Or am I mistaken?

Greetings, Joost

@joost_mineur yours is correct, but of course if this didn’t solve OPs problem then something’s not right.

It’s the earlier exchange that alerted me. There’s no null in Coda, only blank.

1 Like

Sorry, The label should have said “blank space” rather than “blank”. What I wanted to highlight the difference between “” and " ", which is not visible on screens.

P

Thanks to all of you, @joost_mineur, @Piet_Strydom, @Paul_Danyliuk
I now understand a little better.
As for the rest, @Paul, I have no choice but to perform (many) tests, and see what works or not… To understand and assimilate the logic.

Sorry to ask again, @Piet, but now i’m still confused: what’s the difference between “” and " "?

No problem Gabriel, as you said, it is subtle…

" " Is a space. In the ASCII table of characters, it is represented by the decimal 30. It is what you get when you hit the space bar on you keyboard.
“” Is nothing. It is not zero, it is not a blank space. It is the absence of a code in the ASCII table of characters.

1 Like

For sure, i know that ! :wink:
but I wanted to say… what it means in Coda ! :slight_smile:

It is also what it means in Coda.

“” - Coda stores no ASCII code
" " - Coda stores ACIII code 30 decimal

P

1 Like

Thank you Piet, for this clarification!

1 Like

I usually test for both null using .isblank as well as for something else in many of my IF formulas in Coda. There are times when you only need to know if something has data or does not have data but if you need to know what that data is and blank is also a possibility, then testing for both .isblank as well as something else will prevent you from having to worry about formulas not working properly.

1 Like