Location Field - Lat/Lng Values

Tape’s location field is taking an address and performing an auto complete, presumably using Google. It would great if, in these cases, the field also stored the lat/lng values returned by Google and made them available via the API.

@andrew.cranston

If you have the location field already with an address, you can extract the Latitude and Longitude using the following script:

const recordData = await tape.Record.get(current_record_id);

let latitude = jsonata(`data.fields[field_id=123456].values[0].latitude`).evaluate(recordData);
let longitude = jsonata(`data.fields[field_id=123456].values[0].longitude`).evaluate(recordData);

console.info(`Latitude: ${latitude}, Longitude: ${longitude}`);

The field ID for the location field can be found in the developer information window (••• icon on the top bar).

2 Likes

Thanks @Luis ! I see these values have been added.