Geopointe

Shape Fields

Shape fields allow you to associate a geographic area with a record. These shapes can be complex polygons, circles or even lines. Examples of these shapes could be property boundaries, business franchise areas, delivery areas for a restaurant, or water lines.

 

Note: It is important to understand this Shape Field functionality is best used to describe an attribute of a record in your system. It is tempting to use these for some form of territory coverage but that is not how they are designed to be used. They are meant to describe a geographic area specific to a record. Imagine if when creating a new field for a custom or standard object, there was a new field type called Shape. If you are looking to assign records to records to territories/regions, you will want to look into our Assignment Plan feature

This document will explain how to setup and use Shape Fields while also walking through a typical use case. In this example we will build a Shape Field that represents the delivery area for for a food restaurant.

Step 1: Create a Shape Field

The first step to mapping a restaurant’s delivery area is to create a shape field. In our organization we have a custom object called Restaurant. On this object we need to create a new custom field lookup to the Geopointe Shape object.

Screen Shot 2014-07-31 at 2.38.16 PM

Select the Lookup (Relationship) field type.

Screen Shot 2014-07-31 at 2.40.55 PM

Relate this lookup field to the Geopointe Shape object.

Screen Shot 2014-07-31 at 12.57.45 PM

Change the name of the field to reflect the shape area. In this example we will call it Delivery Area. It is highly recommend to check the box that says, “Don’t allow deletion of the lookup record that’s part of a lookup relationship.” This will prevent the shape from being deleted if it is in use by any records.

We also need to create a Lookup Filter for this field where Geopointe Shape: Usage Type = ‘Shape Field.’

Screen Shot 2014-07-31 at 12.59.06 PM

After these steps have been completed continue through the new custom field wizard to set user access and add the field to page layouts as necessary.

Step 2: Enable the Add Shape Action

Once this Delivery Area Shape Field has been created, we need some way to populate and build the shapes. Geopointe includes a record action called Add Shape that allows us to do this. (Learn more about Actions here). First we need to enable this Add Shape action.

Navigate to the Geopointe Setup tab and within this page select the Actions tab.

In the list of Record Actions look for the Add Shape action and edit the record. Upon editing, set the Available (Web) field to true and save it.

Step 3: Add a Shape to a Record

Now we can start to create Shapes and related them to records in our system. In this example I will view a Restaurant record and then click the Map button at the top of the record.

This will load the map and drop a marker on the map for this record. Select the marker on the map to view the info window for this record, then click the Add Shape action.

Screen Shot 2014-07-31 at 2.57.46 PM

This will put the map in shape drawing mode so that we can draw a delivery area on the map. Note the Field picklist currently says Delivery Area but if you have multiple Shape Fields on a record, you can choose which field should be populated with the new shape.

We can also change the shape to a circle and define a range.

Finally, you can also use the Geopointe shape library to define the shape. They will add to the map as you select them in the list. Once satisfied with the shape, click Save Shape. 



If we click the Map button on the Restaurant record, we will see the marker representing the location of the Restaurant and the Delivery Area shape associated with that restaurant.

Thats it! We’ve now created and populated a Shape Field on a custom object in our system.

To edit saved shapes, simply click the shape on the map and then click the Edit option from the Actions drop down list.

Shape Field Searching

Loading the map from a single record will show that record’s related shapes but the next logical step would be to search for multiple restaurants and see all of their delivery areas on the map at once. This is easy to do as well. Sticking with our restaurant example let’s say we have a Contact record and we want to see if this contact lives within the delivery area for any of the restaurants in our system.

We will navigate to Contact record and click the Map button.

In the Data Set drop-down list we will select the Restaurants Data Set.

If we did a search right now we would only see markers indicating the locations of the restaurants. To also display the delivery area we need to make sure the Delivery Area field is included in the list of selected fields for this Data Set.

Select the gear icon next to the Data Set name.

Then navigate to the Fields section and select the Add Field link.

Add the Shape Fields you want to show on the map. In our example this is the Delivery Area field. Make sure you select the field with (Shape) in parentheses.

Now let’s perform a search to find all Restaurants within 0.5 miles of this Contact. On the map you can now see the location of the restaurants as indicated by the pin markers and the related Delivery Area.

We can see the contact (red pin, yellow house) is within the blue shape. Clicking on shape let
s us know this contact is within the Delivery Area for the Thai Tastic restaurant.

IMPORTANT NOTE: When you include a Shape Field in the list of fields for a search the map searches are still looking at the point data for a record and then including the Shape Field area. These searches do not look at the bounds or outline of the shape for searching.

Shape Fields in the Salesforce Mobile App

You can now view shape fields in Geopointe for the Salesforce mobile app. The shape field must be created in the browser version of Geopointe in order to be visible in the mobile app. Simply load the shape field data set to the map to see the shapes. You can then load another data set and tap a shape field to see a summary of records within it, as shown in the screencap below.