For the managed package runtime, retrieve Google Maps data and display a location in the Type Ahead Block using the Google Maps API.
This information is for Omnistudio for Managed Packages. For Omnistudio on standard runtime, see Omnistudio Help.
Beginning with Vlocity Insurance and Health Summer '20, LWC Omniscripts require different configurations for the Type Ahead Block's Google Maps functionality.
This video explains how to use the Google Maps API in a Type Ahead Block:
To add Google Maps autocomplete to a Type Ahead Block:
- Add a Type Ahead Block to your Omniscript.
-
Add elements to the Type Ahead Block to map the response of the Google Maps API.
The response includes:
-
street: Returns a street address
-
locality: Returns a city or town
-
administrative_area_level_1: In the United States, this returns a state
-
administrative_area_level_2: In the United States, this returns a county
-
postal_code: Returns a postal code
-
country: Returns a country
-
- In the Type Ahead Block's properties, expand the Google Maps Autocomplete section and check the Enable Google Maps Autocomplete checkbox.
- (Optional) To hide the Google Map widget, check Hide Map.
- In the Google Maps API Key field, enter your Google Maps JavaScript API key. If you don't have a Google Maps JavaScript API Key, obtain one from Google.
- Click the Country Filter field and select a Country.
- In the Google Transformation section, select an Output JSON element and map it to an Input JSON field.