Description
Location field stores coordinates and some meta-data (City, Country, Region, etc).
Field UI
It should be possible to find address via autocomplete, like this. Most likely it should work via Google API, but maybe there are other options.
After Phone field in new field
Add [new] label
Icon for this field
Use it for Map View
Location field contains exact coordinates to use them for Map View
Extract some meta data
It should be possible to extract meta data from Location in some places:
MUST HAVE: Formulas. In this case I will be able to create new Formula, like Country, and put data from Location into it via something like Location.Country
NICE TO HAVE: Have native fields in filters, units, etc (similar to date range). In this case I will be able to show Location.Country on card, use it in filters, in sorting, etc.
Possible tech solutions
Store Location data on JSON and somehow make it work for Formulas
Store Location data in a Database (like State) and have columns for meta-data like Country, City, …. In this case it seems Location.Country is a natural solution for formulas and it is also may be possible to have it in filters and units.
JSON response from Google API (example), note that it has meta for everything, like state, country, etc. formatted_address is good to have as a default text for Location field
"formatted_address": "1600 Amphitheatre Pkwy, Mountain View, CA 94043, USA",
{
"results": [
{
"address_components": [
{
"long_name": "1600",
"short_name": "1600",
"types": [
"street_number"
]
},
{
"long_name": "Amphitheatre Parkway",
"short_name": "Amphitheatre Pkwy",
"types": [
"route"
]
},
{
"long_name": "Mountain View",
"short_name": "Mountain View",
"types": [
"locality",
"political"
]
},
{
"long_name": "Santa Clara County",
"short_name": "Santa Clara County",
"types": [
"administrative_area_level_2",
"political"
]
},
{
"long_name": "California",
"short_name": "CA",
"types": [
"administrative_area_level_1",
"political"
]
},
{
"long_name": "United States",
"short_name": "US",
"types": [
"country",
"political"
]
},
{
"long_name": "94043",
"short_name": "94043",
"types": [
"postal_code"
]
}
],
"formatted_address": "1600 Amphitheatre Pkwy, Mountain View, CA 94043, USA",
"geometry": {
"location": {
"lat": 37.4224428,
"lng": -122.0842467
},
"location_type": "ROOFTOP",
"viewport": {
"northeast": {
"lat": 37.4239627802915,
"lng": -122.0829089197085
},
"southwest": {
"lat": 37.4212648197085,
"lng": -122.0856068802915
}
}
},
"place_id": "ChIJeRpOeF67j4AR9ydy_PIzPuM",
"plus_code": {
"compound_code": "CWC8+X8 Mountain View, CA",
"global_code": "849VCWC8+X8"
},
"types": [
"street_address"
]
}
],
"status": "OK"
}
Scope
Refs
Notion
https://www.reddit.com/r/Notion/comments/kj3uq2/add_location_property_and_map_view/
Monday
https://support.monday.com/hc/en-us/articles/360001144325-The-Location-Column
https://developer.monday.com/api-reference/docs/location
Trello
ClickUp uses Google Maps to handle location field somehow
https://youtu.be/ZmcS_K23y-U
??
notes
fibery-core does not support expressions around json value. You cannot get a property from json-value, you can get only whole value via API. However formula svc calculates formula value executing expression using query language, so if you are going to use some component value from Location Field (e.g. xxx.Country) in a formula we must implement json access functions in query language or implement Location Field using some other approach
Solution Proposal
Final solution of 23.01.2023 → fibery/location field Dmitry KabakFYI
FYI: Sergey Truhtanov Eugene Kisel
After sync discussion with Alexey Liplyanin
Location field type must contain place longitude and latitude.
Location field type may contain place geographic/political detalisation with open set of keys with string values:
{Country = "Cyprus", City = "CITY", ...}.
Set of keys is not defined during design time and client is responsible of it. How to support it in formulas? reports?
Location field type must be supported for Functional Areas:
Formulas (yes)
Units (full address or fall back to lat/long)
Filtering (no) (yes)✅
Sorting (no)✅
Reports? (no support)
Automations (??? - no by default) ✅
History (yes)✅
App templates import/export ✅
Integration (no) ✅
Permissions✅
Sharing ✅
Export (full address as text or coordinates) / Import (only coordinates…) ✅
.GraphQL ✅ [Graphql] Add support of location type
We can add Location field type by analogy as DateRange type, i.e. primitive type with a set of defined query selectors to be able get field values parts in the query but client must update that field atomically with a whole field content (no partial update).
This way gives us field support in all areas enumerated above in the analogous way as for DateRange type — each area should be touched to add the support of location query selectors.
Conceptually Location field type can be used in all places where DateRange is used except its timeline specifics.
Location type proposal is here fibery/location field
Michael Dubakov Important! We do not add support of "geometrical" predicates around longitude + latitude!
No filters like — give me all peasants around Minsk but not far than 5 km.
(longitude, latitude) do not participate in filtering/ordering.
Only address parts (Country, Region, …) participate in filtering/ordering.
UI proposal
https://www.figma.com/file/QPQX7qbCAjCvPZ2FrFxqw7/Improvements-%5BWIP%5D?node-id=606%3A12337&t=tlCpjwoxccR8MDIJ-4