The Google Maps sample app is a ready-to-import example of Address Validation for Dataverse configured with Google Maps. It shows the Google Maps autocomplete control on Account and Contact forms, including the Google Places business details (name, phone, website, Google Maps link and more), and two Power Automate flows that check each address with Google Address Validation. Use it to try Google Maps in a few minutes, and as a reference when you configure your own forms.
The sample contains no API keys: you bring your own key, and the sample's Setup page stores it in your environment. Download it from the SharpXRM sample apps repository on GitHub.
What the sample contains
| Component | Details |
|---|---|
| Solution | SharpXrmSampleGoogleMaps, publisher SharpXRM Samples (prefix sxs) |
| App | Google Maps Address Sample: a model-driven app with a Setup page, Accounts and Contacts |
| Forms | Account and Contact main forms and quick create forms with the Sharp XRM - Google Maps Autocomplete control on the address search box, the standard address columns it fills, and a column for every extra output of the control |
| Columns | Sample columns named sxs_gm_* on Account and Contact, so samples never collide with each other or with your own columns |
| Setup page | Saves your key in the API Configuration SharpXrmSample_GoogleMaps, validates it and shows your license status |
| Power Automate flows | Verify account address with Google Maps (sample) and Verify contact address with Google Maps (sample), which verify each new or changed address with Google Address Validation, write the verified address back and add a note |
| Connection reference | Google Maps sample - Dataverse (Microsoft Dataverse), used by the flows |
Before you start
- Address Validation for Dataverse installed and licensed in the environment. A trial license works, but it must cover Google Maps. See Download and Install Address Validation for Dataverse.
- A System Administrator or System Customizer to import the solution, and a System Administrator or SharpXRM - Address Validation Administrator to run the Setup page.
- A Google Maps API key (see step 1).
Step 1: Get your Google Maps key
- In the Google Cloud console, select or create a project and open Credentials to create an API key.
- Enable these APIs for the project: Maps JavaScript API and Places API for the autocomplete control (also enable Places API (New), used by newer versions of the control), and Address Validation API for the verification flows.
- Restrict the key to the APIs above. The flows call Google from Dataverse, not from a browser, so do not restrict the key to websites (HTTP referrers) only; if you need a website restriction for the control, create a second key for the flows.
For more details, see Setup your Google Maps API Key.
Step 2: Install the sample
- Download the managed solution: SharpXrmSampleGoogleMaps_1_0_0_0_managed.zip. To change the sample (for example the forms or the control settings), use the unmanaged solution instead: SharpXrmSampleGoogleMaps_1_0_0_0.zip.
- In the Power Apps Maker Portal, select your environment, then go to Solutions > Import solution and import the zip file.
- When asked for the connection reference Google Maps sample - Dataverse, select or create a Microsoft Dataverse connection. The flows are turned on when the import completes.
Step 3: Configure the sample
- Open the Google Maps Address Sample app. It opens on the Setup page, which shows the status of Address Validation, your license, the API configuration and the verification flows.
- In 1. Enter your API key, enter your Google Maps API key and select Save and validate. The page creates or updates the API Configuration SharpXrmSample_GoogleMaps and checks the key with Google Maps.
- Check that the status lines are green. If a form was already open, refresh the browser tab (F5): the controls keep their configuration in the browser.
Step 4: Test address autocomplete
- On the Setup page, select New sample account or New sample contact. Quick create account and Quick create contact open the same control on the quick create forms, which + New also uses in the app.
- Start typing a street address in Address search and pick a suggestion. Try: 1600 Amphitheatre Parkway, Mountain View. To see the Google Places outputs, search for a business name instead, for example Googleplex.
- The standard address columns and the provider's extra outputs fill in. Save the record to keep them.
Step 5: Test background verification
A few seconds after you save a record, the sample flow for that table:
- verifies the address with Google Address Validation (action
sharpxrm_VerifyWithGoogleAddressValidation) through the Microsoft Dataverse connector, - writes the verified address back to the standard address columns (street, unit, city, county, state, ZIP or postal code, country, latitude and longitude),
- adds a note with every value returned, the address that was sent, what was written back and the full response.
Refresh the form to see the note in the Notes section. While a check is running, the Last Verified Address sample column reads PENDING.
The flows use the same API key as the control. The Address Validation API must be enabled on it. Each address change uses one Google Address Validation request.
The flows only act on records whose address was picked with this sample's control (the sample Full Address column is filled), so they never change your other Accounts and Contacts. They also skip their own updates. Use them as a starting point for your own flows; see the related articles below.
What the forms show
| Control output | Column on Account and Contact | Type |
|---|---|---|
street | Street 1 (address1_line1) | Standard column |
unitNumber | Street 2 (address1_line2) | Standard column |
city | City (address1_city) | Standard column |
county | County (address1_county) | Standard column |
state | State/Province (address1_stateorprovince) | Standard column |
zip | ZIP/Postal Code (address1_postalcode) | Standard column |
country | Country/Region (address1_country) | Standard column |
latitude | Latitude (address1_latitude) | Standard column |
longitude | Longitude (address1_longitude) | Standard column |
fullAddress | Full Address (sxs_gm_fulladdress) | Sample column |
PostalTown | Postal Town (sxs_gm_postaltown) | Sample column |
AdminLevel3 | Admin Area Level 3 (sxs_gm_adminlevel3) | Sample column |
AdminLevel4 | Admin Area Level 4 (sxs_gm_adminlevel4) | Sample column |
AdminLevel5 | Admin Area Level 5 (sxs_gm_adminlevel5) | Sample column |
AdminLevel6 | Admin Area Level 6 (sxs_gm_adminlevel6) | Sample column |
placesBusinessName | Business Name (sxs_gm_businessname) | Sample column |
placeBusinessStatus | Business Status (sxs_gm_businessstatus) | Sample column |
placesPhoneNumber | Business Phone (sxs_gm_businessphone) | Sample column |
placesBusinessURL | Business Website (sxs_gm_businesswebsite) | Sample column |
placesGoogleMapsURL | Google Maps Link (sxs_gm_googlemapsurl) | Sample column |
placesVicinity | Vicinity (sxs_gm_vicinity) | Sample column |
placesTypes | Place Types (sxs_gm_placetypes) | Sample column |
placesEditorialSummary | Editorial Summary (sxs_gm_editorialsummary) | Sample column |
(verification flows) | Last Verified Address (sxs_gm_verifiedaddress) | Sample column |
Use the sample with other users
- Share the Google Maps Address Sample app with their security role (Power Apps > Apps > ... > Share).
- Make sure their roles can read Accounts and Contacts, and give them the SharpXRM - Address Validation User role so the control can read its configuration. See Assign privileges for users.
Remove the sample
Delete the SharpXrmSampleGoogleMaps solution from Solutions. This removes the app, forms, Setup page, columns and flows. The API Configuration records the Setup page created are kept; delete them from the Address Validation for Power Apps app if you no longer need them. Several samples can be installed side by side.
Troubleshooting
| What you see | What to do |
|---|---|
| Setup page: Address Validation for D365 is not installed | Install Address Validation for Dataverse first, then reopen the app. |
| Setup page: license message | Open the Address Validation for Power Apps app to start a trial or activate your license. The license must cover Google Maps. |
| Setup page: saved, but it could not be validated | Check the key and the notes shown on the page. |
| The form shows the address box but no suggestions | Refresh the browser tab (F5) so the control reloads its configuration. |
| The control shows a license message instead of the address box | The license is missing, expired, or does not include Google Maps. |
| No note appears after saving | Check the Verification flows line on the Setup page: the flows must be on and their connection set. The flows only act when the address was picked with the sample's control. Open the flow in Power Automate to see its run history. |
| A note says Address verification failed | The note includes the details. Usually the verification key is missing or invalid (run the Setup page again), or the license does not cover the provider. |
| The control shows no suggestions, or a Google error | Check that the Maps JavaScript API and Places API are enabled for the key and that any website restriction includes your Dynamics 365 address, for example https://yourorg.crm.dynamics.com/*. |
| The verification note says the request was denied | Enable the Address Validation API on the key, and make sure the key is not restricted to websites only. |