Populate Latitude and Longitude on existing locations in cmn_location table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2026 11:12 AM
I am trying to solve a problem with the map displaying locations in the cmn_location table.
- I performed a bulk data load of locations to the cmn_location table.
- Latitude and Longitude are not populating.
- When I manually enter a Latitude and Longitude it does show up on the map.
- I have obtained a Google Maps API key and populated the following entries on the Google Maps Properties page. (Note, one key has been put in each of the following) (See screenshot with redacted key)
- "Private key for Google Maps API for Business".
- "Map key from Google, tied to the URL of the server".
- Customer provided Google Maps key used for geocoding requests".
- I made sure the get_lat_long for the Location [cmn_locaiton] is active.
- I went to schedule job "Refresh Latitude Longitude info of Records"
- It is active.
- I forced it with an "Execute Now" (I really don't think it did anything. I don't know how to identify if it actually ran and succeeded or failed. I tried going to the dashboard but could not find anything for this job or nothing that I could interpret as it worked or failed.)
I'm sure that I'm missing something. Does anyone have any thoughts on what I am missing or what I should do to populate the lat and lon?
Thank you in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2026 11:22 AM
Issue
After Google maps api are set up correctly, the latitude and longitude are not getting updated on location cmn_location after creating or updating addresses in the same table.
Resolution
- Activate the Process Geocoding Request scheduled job:
https://<instance_name>.service-now.com/nav_to.do?uri=sysauto_script.do?sys_id=002c1e70eb11020079a62a7ac106fe26
When a Company or Location record is created, or has one of its address fields changed [street, city, state, zip or country], the get_lat_long business rule is triggered. This business rule uses the GoogleMapsHelper script include to create sys_geocoding_request records.
The scheduled job Process Geocoding Request must be enabled to process sys_geocoding_request records. Process Geocoding Request uses the Google Map service to populate the latitude and longitude fields of the changed or created Company and Location records.
just FYI- check this KB as well :KB0522699 The get_lat_long business rule is not populating latitude and longitude
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
first, the BR get lat long only works on insert, run a background script for existing data to "update" them if you loaded cmn_location records before you configured google map keys
then also, make sure you have set up the right config, see below.
Cause
The HTTP referrer restrictions in Google Premium API keys no longer function as they did previously. To fetch, map, and geocodes, it requires two separate keys, client and server.
Resolution
We need to generate 2 keys instead of 1(as it was before).
First is Client key, that can have the HTTP referrer restrictions, applicable for browser, that would be used to get MAP.
Second is Server key, that would be applicable for selected APIs, needed to fetch the GeoCodes (latitudes and longitudes).
Below are the steps to be followed.
- In Google Developers Console, sign in > add billing details which is now required for Google APIs > you will likely get some free credits that will help while integrating with your Bubble app > create a project and make sure your billing details is enabled for that project
- From the menu, select 'API & Services' > credentials > click 'create credentials' > generate 2 API Keys with one called Client and another called Server to help you identify which is being used for a call > we will refine settings for these keys in the next steps
- For Client key
- Application restrictions > enable 'http referrers' > add your app domain like this 'https://client.service-now.com/
- API restrictions> none required
- For Server key
- Application restrictions > none required
- API restrictions:
- Geocoding API
- Places API (NEW) → careful, don’t select PLACES API, select the one with (NEW)
- Routes API
- Maps JavaScript API
- Back in your ServiceNow application, Navigate to System Properties > Google Maps.
- Update the keys as given in the screenshot below.
Add me on LinkedIn 🙂 https://www.linkedin.com/in/joshuachen0510/