Is it possible to calculate the number of unique/individual cities (text strings) on a bubble app?

Hi folks!

I would like to count the number of different individual cities, that my app is being used in. I have a database item, called “listing” in my app (like on airbnb), that includes a google geo location address , so it is possible to extract the city names from that dataset. (I know a text string is not ideal for counting and summing up values, because of its proneness to error, but can’t figure out an alternative to this)

For example, if I had 3 listings in 2 cities:

  1. New York,
  2. New York
  3. Miami,

I would expect the result of the calculation to express:
2 different cities
(1. New York, 2. Miami)

So it would need to treat the 2 “New York” values as 1 individual value, because they are identical, and find 1 other value (“Miami”) to sum together to reach the final value of 2 different individual cities.

Use the: unique operator

1 Like

Do a search for Listing:each item's address:extract city:unique items:count ?


That seems to get the correct result! Thanks @tylerboodman for excellent advice!

1 Like

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