Templating the GeoPoint field

The GeoPoint field is used for Geolocation coordinates. It works by adding coordinates or by pasting a Google Maps URL.


Before Reading

This article assumes that you have saved the document object in a variable named document as shown in the Retrieve the document object page.

Access the longitude and latitude

Here is an example of how to retrieve the coordinates for a GeoPoint field. In this case, the GeoPoint field has the API ID of location.

Copy
const lat = document.location.latitude;  // latitude
const long = document.location.longitude; // longitude