How to Sort Yes / no (Bool) type on Repeation Groupe

It dosen’t change sort order when I set descending order “yes” or “no” that use Yes / no (Bool) type on Repeation Groupe.
It sort 「bool yes → no」 everytime.

Dose anyone knuow why and how to?

Is it possible your "no"s are really just empty? I think I’ve seen that happen especially if the field was added later

2 Likes

It was that field is empty. I solved!
Thank you @tylerboodman !!!

1 Like

Whoa, that’s kind of weird. And, if so, that’s sort of a bug. Empty (null) should be falsey in all contexts. I’ve tried to abuse the apparent “tri-state” nature of Bubble’s yes/no datatype at times but I can’t recall an actual context in which that worked. But here we are.

1 Like

Yes please help me and report it as well :joy: . It confuses me that when you create a yes/no field it doesn’t default the default to anything…

I’ve had conditional statements not consider blank as “no” but the expression picker doesn’t let you account for empty fields either when it’s yes/no

2 Likes

Well, empty (which in JavaScript is null or vice-versa really) should evaluate to false in all contexts.

For example, I don’t bother to publish initial states for my plugins’ exposed states (outputs) because even for boolean (yes/no) outputs like “Initialized”, empty will evaluate to false. (So if you ask “Initialized is yes” you’ll still get the right answer. And, in this specific context, I’m pretty sure that asking “Initialized is no” [when the state is empty], correctly returns “yes”.)

Also. lists of yes/no values in Bubble do not support empty values. There is no way to preserve empty yes/no values except to convert the empties to no.

So, anywhere we see “trinary” rather than “binary/boolean” behavior would be a bug in Bubble.

Anyway, @tylerboodman if you do actually report a bug about this, let me know the report number and I’ll submit my own referencing it.

1 Like

@tylerboodman @keith
How about text(String) type and number type ? It is also null comes bottom. Is this normal?

Yes seems like it just leaves blanks at the bottom no matter what. I was able to work around it by searching for the thing constraining the field was empty, then doing :merged with my regular search.

I think it’s just their programming considering empty as neither lesser nor greater on the ascending scale. Maybe they need a checkbox saying “Consider empty as least”

1 Like

I see. That’s a little tricky to handle.
Thank you @tylerboodman .

1 Like

Yes, @nakano_satoko, and this is the default behavior of the Array.sort() method in JavaScript (so that’s why that happens).

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.