Empty strings are removed from lists automatically?

Hi All,

I was surprised today that when I had a Text column, and I tried filtering for empty values, that the result is an empty list. The empty rows are ignored:

image

Also simply Table with some empty text values.Name.Count() is 2, where I would expect 3.

List("", "").Count() also outputs zero. Is this by design? Seems odd.

1 Like

Well I tried with a number column instead and it has the same behavior, blank values are excluded. I guess it’s by design then. However it’s odd because an empty string is a valid string. But I see the issue, since Coda doesn’t have an explicit “null”-style value, so there is no way to discern if someone entered an empty string vs an explicit blank value. Oh well. :slight_smile:

Yeah, this is by design. Not sure if that was the intent, but this is standard in SQL too.

Use .CountAll() to also calculate blanks as items.

To calculate only the blanks you can .CountIf(CurrentValue.IsBlank()) instead of a filter.count

5 Likes

CountAll! Great thanks.

I was assuming the values were simply gone from the list. They were just hidden by the Count formula. CountAll() includes them in all cases, and FormulaMap/ForeEach also shows the elements exist in the list. Thanks :slight_smile:

image

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