Numeric ranges (similar to date ranges) can be constructed with the expression builder in fields of numeric range type.

The general form of a numeric range is like this:

some_number <- range -> some_other_number

This seems quite straightforward. However, fields of numeric range type do not allow you to construct the range via numeric literals.

(“Whatever do you mean?” you are asking.)

Well, in a field of numeric range type, you can’t do this:

1 <- range -> 10

We can all understand that this would create a numeric range bounded by 1 and 10.

However, we cannot enter the literal values 1 and 10. That is, we cannot type them in.

We must instead use some variable, such as an output from some plugin, an expression that resolves to a number, or a custom state that holds a number instead.

The assumption that Bubble makes here is that numeric ranges are only ever created by the slider widget. But of course this isn’t true. We can create whatever numeric ranges we desire, but we can’t create them with literals.

Easy enough. Just get your min and max values from a variable and range those.

4 Likes