//Set the longitude and latitude as the outputs. Use this to save the coordinates to a table/view.
output.set("latitude", latitude)
output.set("longitude", longitude)
Input Variable → Address
We will need to put the address into the script so it can be converted into coordinates.
To do this we use an input variable → make sure it has the Name as address.
Mapbox Token
Copy the mapbox token and paste it into the script.
Test your Script
Click the test button and you should see it run successfully with input as the address and output as two coordinates.
Update Record
In the next step update the record Latitude and Longitude fields → using the outputs from the script.
Result
Once the script works, you’ll have coordinates you can plug into your map component.
Run Automatically
When you have confirmed it works for your records by triggering them with checkboxes - switch to an automation flow that works for your use case.
On Demand : when [coordinates] is empty and [address] is not empty → good for systems where new records are added from external sources.
Interval : every [day] find records where [same condition as above] and repeating group [run the script] then [update record] → good for systems where the addresses are added manually.