Comment on page
Location Magic Text and Formatting
You can use Magic Text to access location properties or their sub-properties for using in creating, updating, filtering, or labeling inside your application.
Skill Level: Intermediate
Whenever you have a field that is linked directly to a Location property in the database, you will have the option in Magic Text to only choose the Location option with an icon beside it. This represents the location value as a whole. For instance, when creating a new trip we might have a location property that will only accept a Location value.
By contrast, you can also access the sub-properties of a location as long as the field being filled is not tied to a location property type. For example, we can have a location's latitude be saved into a number field, or the location name be saved into a text field.
Saving latitude (a number property of location) into a number field.
Saving a location's name in a text property of a newly created Trip.
You can also build custom formatted locations by using the same property type, choosing a different piece of data, and combining it with static text. In the example below, we created a custom format that lists the postal code, then the city, then the latitude of the user's device - all using the same location property, just with different parts of the location.
With latitude and longitude, you can also format the way the coordinates are displayed to your end user, by clicking on the pencil icon in the red Magic Text bubble whenever latitude and longitude is displayed in an input. Decimal is the default formatting. To learn how to use latitude and longitude in formulas, please see this article.