Handle multiple values and table columns with one Custom filed type

Hello !

With my team we are taking a look at strapi to compare with our homemade CMS, and we are currently looking into how to handle our geolocation the same way we do on our CMS.

To store our geolocation data we have multiple columns : latitude, longitude, address, zip_code, city, country.

We could just create a component with those fields in the content type builder but we need more control on the fields in the Create and Update forms as they interact with each others and we need to display the address corresponding to the data on a map as follow.


We can either enter the address, or enter our adress’s latitude and longitude if the toggle “Position du pointeur libre” is ON, these values can also be dynamically changed by moving the marker on the map.
The other fields are inferred using geocoding and reverse geocoding.

We looked into creating a single custom field type to add all our fields however as its name implies its supposed to be just one field and it only register data for 1 column.

Is there any way we could handle all those fields using the custom field type or some kind of custom component ? Maybe by using lifecycle hooks or something like that ?

I would not recommend using a component for this kind of usecase. Components do not have API endpoints so it would make interaction with the data needlessly complex when making API calls.

Have you considered using a JSON field inside your content-type to store the information generated from your UI?