How to add a Google address picker field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2022 08:11 AM
I have a requirement to implement a google search field in the NavUI and Agent Workspace. The user should type a portion of and address and a dropdown list picker is shown below the search box. When a user clicks an address in the list, that address is used to populate other fields in the screen.
How can this be achieved? The ServiceNow built in Google Maps API does NOT provide such a field. I do not want to see a google map, I only want a textual list of address places in a picker.
See attached image of a similar picker I built in another site.
- Labels:
-
Now Experience UI Framework

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2022 08:59 AM
You can use Google Place Autocomplete REST API to get address from the string.
https://developers.google.com/maps/documentation/places/web-service/autocomplete
This API accepts part of the address string and returns address JSON which you can parse from script include.
Regards,
Sachin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2022 09:16 AM
Yes I already have a script include that I can call in a client script through GlideAjax but I don't know how to implement this in a user friendly UI picker.
I thought maybe I need to create a custom widget, but that only seems to work in the Service Portal. I'm so lost here.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2022 09:19 AM
Call onchange client script for this field and use g_form.setValue('your_field_name',<response_returned_From_async_ajax_call>) .
Regards,
Sachin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2022 09:20 AM
What field type would you use, would it be a list field or a popup window?