Drag a Pin to Update a Location
Let a service dispatcher drag a misplaced customer site to its real entrance on the map, then save the new latitude and longitude with Update Records.
A service dispatcher sees a customer site pinned in the middle of a park: the geocoder placed it from the address, but the loading dock is two blocks away. She drags the pin to the right spot and clicks Next, and the flow writes the new latitude and longitude to the account.

Before you start
Dragging markers is a Leaflet feature. Leaflet maps load their tiles from OpenStreetMap: add
https://tile.openstreetmap.orgto Setup > Trusted URLs.Accounts with a Billing Latitude and Billing Longitude.
Users of the flow need edit access to those two fields.
Steps
Get the sites to correct
Create a Screen Flow.
Add a Get Records element on Account, filtered to the sites to review (for example Billing City equals
San Francisco), and store All records.Choose the fields to store yourself: Id, Name, Billing Latitude and Billing Longitude.
This tutorial uses the Variable data source on purpose: the Map then hands back the dragged records with their new coordinates already set, ready for Update Records.
Add the Map and point it at the records
Add a Screen after Get Records and drag the Avonni Map onto it. Set its API Name to
SiteMap.Click Edit Component. Set Type to Leaflet and Mode to Multiple Markers.
Under Data Source, choose Variable and select the Get Records collection.
In Data Mappings, map Title to Account Name, Location > Latitude to Billing Latitude and Location > Longitude to Billing Longitude. Keep Value on the record Id.
Save the new positions with Update Records
Each drop updates the Map's Dragged Map Markers SObject output: one Account record per pin moved, with Billing Latitude and Billing Longitude set to the new position.
After the screen, add a Decision with one outcome, Pins moved:
{!SiteMap.draggedMapMarkersSObject}Is EmptyFalse.On that outcome, add an Update Records element.
Choose Use the IDs and all field values from a record or record collection and select Outputs from SiteMap > Dragged Map Markers SObject.
The Decision skips the update when the dispatcher clicks Next without moving anything.
Save and test
Activate the flow and run it with Debug or Run (dragging does nothing in the Component Builder preview). Drag one pin a few blocks and click Next. Open the account: Billing Latitude and Billing Longitude hold the position where you dropped the pin. Run the flow again and the pin starts from its new place.
Variations
Save on drop, without Next. In the Interactions tab, add a Marker Drag interaction. Set Type to Flow Navigation, then the second Type to Next Screen. Each drop moves the flow on and saves at once, which suits a dispatcher who fixes one site per run. See Flow Navigation.
Save only the last pin moved. The Map's Dragged Marker Latitude and Dragged Marker Longitude outputs are text. Create two Number formulas,
VALUE({!SiteMap.draggedMarkerLatitude})andVALUE({!SiteMap.draggedMarkerLongitude}), with a scale of 6 or more. Then use an Update Records element that finds the Account whose Id equals{!SiteMap.draggedMarkerValue}and sets Billing Latitude and Billing Longitude to the two formulas.
Troubleshooting
Related tutorials
Create a Clickable Map with Account Details: show the account behind a pin beside the map.
Customize the Map Marker: color the sites that still need a check.
Draw a Territory and Save It to the Record: save a shape drawn on the map instead of a single point.
Was this helpful?

