Geovonic Avatar

Live Salesforce data in my web map

If you’re using Salesforce at your organisation, you were probably excited to see that Geovonic Connect has a plugin available for fetching customer and account information straight out of Salesforce.

We use Salesforce ourselves and in this blog post I wanted to quickly walk through how we’ve used Geovonic Connect to link to our internal local government customer map.

 

The existing map

For tracking sales activity across the local government sector, we have a web map showing each of the local government areas with the status of the account. It provides a great way of seeing which councils we are working with across the country.

We wanted to be able to also see information about the products they have access to and who the key contacts are at each council. The traditional way to do this (before Geovonic Connect!) was to run a nightly ETL process to pull the data out of Salesforce and append it to the ArcGIS feature layer data. But now we don’t need to do that and can use Geovonic Connect to pull the live data from Salesforce directly into the map.

The good news for me when setting this up is that the NAME attribute on the LGAs in the ArcGIS feature layer is the same as the account name in Salesforce. That makes it nice and easy to relate the customer data with the map features!

Building an SOQL statement

Salesforce uses a query language called SOQL (Salesforce Object Query Language) that is very similar to the SQL we’re all familiar with for searching across databases. They also provide a handy query builder workbench that allows you to pick the objects and fields that you want to return.

You can access the query builder here. You’ll need to be logged in to your Salesforce account to use it.

For my map I’m going to use a couple of different queries to retrieve the information I want.

The first one retrieves the 10 most recently updated contacts for the account.

SELECT Email,Name,Phone,Title FROM Contact
WHERE Account.Name = '{{NAME}}'
ORDER BY LastModifiedDate DESC
LIMIT 10

The second one retrieves the list of products that are linked to the account.

SELECT CloseDate, Name FROM Opportunity
WHERE Account.Name = '{{NAME}}' AND IsWon = True
ORDER BY CloseDate DESC NULLS LAST
LIMIT 10

You’ll notice that for each of them I have used the {{NAME}} syntax in place of the account name. This is the syntax that Geovonic Connect uses to substitute an attribute from the map into the query. So these queries will be called for each of the selected map features, passing in the name attribute in place of {{NAME}}.

Configuring Geovonic Connect

Now that I’ve built and tested my queries in the workbench, I am ready to configure the relationship between my map layer and the Salesforce contacts and products in Geovonic Connect.

Note: The Salesforce data source is a premium Geovonic Connect plugin. It will only be available in your dashboard if your account has access to it. Contact our support team if you want to learn more about getting the Salesforce data source.

When adding a Salesforce data source in Geovonic Connect, you need to include a security token. I found this helpful guide steps through how to get a security token.

I added two layer links in the Geovonic Connect dashboard. One for contacts and one for products. The screenshot here shows the layer link configured between by LGA map layer and the Salesforce data source, using the query I built earlier.

Adding Geovonic Connect to the map

Now that I’ve defined my layer links, I simply add the Geovonic Connect widget to my mapping app and I can view data from Salesforce.

Note: I’ve faked up the data shown on the widget here for the purposes of this post!