---
title: "Geocoding for FieldBuddy"
canonical: "https://help.fieldbuddy.com/space/FBDOCS/5371723777/Geocoding%20for%20FieldBuddy"
format: markdown
---
> ℹ️ This guide requires Administrator permissions to do the set-up and access to your Google account.

This guide will explain you how to set-up Geocoding in your organization. This is required for a user to use the FieldBuddy Dispatch Panel Map.

## 🔖 Introduction

As defined, Geocoding or Address Geocoding, is the process of taking text-based description of a location, such as an address and returning geographic coordinates - latitude and longitude pair.

In FieldBuddy, we have an out of the box solution, that can leverage *Google Geocoding API* and add some clarifications into Location records by populating Coordinates (Latitude and Longitude), as well as the address that was actually geocoded. That information is stored on Location (`FIELDBUDDY__Location__c` object) and it is being used in Dispatch Panel in order to show on map locations of various Work Order and Resource

That is not free. Pricing can be fond here - [https://developers.google.com/maps/documentation/geocoding/usage-and-billing](https://developers.google.com/maps/documentation/geocoding/usage-and-billing) 

But as for today, Google generously gives 200 USD worth SKU credits, which would be enough to geocode near 40k of locations every month on free tier. But it will be still necessary to specify credit card or company banking account.

All the fields referenced below are in Managed package (so with prefix `FIELDBUDDY__`)

All fields are on Location object.

| **Label** | **API Name** | **Description** |
| --- | --- | --- |
| Geocode Status<br>*picklist* | `FIELDBUDDY__Geocode_Status__c` | Information about Geocoding process |
| Geocode Address<br>*text area* | `FIELDBUDDY__Geocode_Address__c` | Which address was actually geocoded via last geocode attempt |
| Coordinates<br>*location* | `FIELDBUDDY__Coordinates__c`<br>`FIELDBUDDY__Coordinates__Latitude__s`<br>`FIELDBUDDY__Coordinates__Latitude__s` | GPS address of last geocode attempt |

## \uD83D\uDCD8 How it works

Information about geocoding is stored in Geocode Status (`FIELDBUDDY__Geocode_Status__c)` field. That can be one of the four values:

- **Draft**. Set as default for every new record unless explicitly mentioned
- **Skipped**. Can be specified explicitly. Then Geocoding will ignore this record.
- **Failed. **Set by geocoding job automatically when last attempt of geocode failed.
- **Precise Match. **Set by geocoding job automatically when last attempt of geocode found exact match.
- **Partial Match. **Set by geocoding job automatically when last attempt of geocode found partial match (like not exact house but street or area).

Unless status is **Skipped**, every time when one of the Address fields on FieldBuddy Location object is changed, Geocoding Status is automatically updated to Draft, Geocode Address and Coordinates are emptied.

Then queueable job is enqueued to make a callout to Google API in async mode and in that job, Geocode Status (`FIELDBUDDY__Geocode_Status__c`), Geocode Address (`FIELDBUDDY__Geocode_Address__c`) and Coordinates (`FIELDBUDDY__Coordinates__c`) are updated.

#### Important notes for implementation

- It can easily be a case, that location is not valid and geocode will still return partial match. It will take the closest possible location. Therefore during implementation, please pay attention to the Geocode Status and Geocode Address (`FIELDBUDDY__Geocode_Address__c`) field, since data in Coordinates (`FIELDBUDDY__Coordinates__c`) are GPS address of Geocode Address (`FIELDBUDDY__Geocode_Address__c`).
- It is chunked 30 locations per 1 queueable job. That’s why it is important to avoid BULK data loads with chunk size 1500.
- Since geocoding is async, it is necessary to avoid batch jobs (like FlexConnect import) with job size > 30, because it will trigger a queueable job.
- Locations with RecordType **Sublocation** are skipped
- It is possible only to use Postal Code and Country to do Geolocation. It is inside Internal Settings – ask FB team to enable it (can be handy for some countries like Ireland)

You can check guide how to configure it here - [https://upperdeck.atlassian.net/wiki/spaces/FBDOCS/pages/4790747137](https://upperdeck.atlassian.net/wiki/spaces/FBDOCS/pages/4790747137)