Showing a small map in a Salesforce record detail view can be very helpful in making decisions. TaroWorks allow you to create records and capture GPS location data from the field. The coordinates are stored in the Geolocation field type. This article will show how you can get a very neat map as shown below using two formula fields in your object.
These steps assume that you have a Geolocation field (named "TestGeolocation" here) already created and mapped to a survey question in TaroWorks.
- In the same object, create a text formula field called Map Link using the formula:
"http://maps.googleapis.com/maps/api/staticmap?center=" & TEXT(TestGeolocation__Latitude__s) & "," & TEXT( TestGeolocation__Longitude__s ) & "&zoom=12&size=300x300&sensor=true&markers=color:red%7Clabel:A%7C"& TEXT(TestGeolocation__Latitude__s) & "," & TEXT(TestGeolocation__Longitude__s)
- Then, create another text formula field called Map Display using the formula:
IF( OR( ISBLANK( TestGeolocation__Latitude__s ) , ISBLANK( TestGeolocation__Longitude__s ) ) , "Missing Coordinates", IMAGE( Map_Link__c , "", 300,300))
- Your exact formula will change if you used a different name for your Geolocation field.
- You can also change the size of the map image, zoom level of the map, colour of the marker of the map (or even plot multiple points of the map!) if you are familiar with the URL format for the Google Map API.
- There is a limit on how often you can use (or "call" to use the technical term) these Google maps per day for free. For more intense usage, please contact Google.