Integration»Quick Start Guide

Quick Start Guide

Integrating fmMap in 10 minutes or less.

Overview.

For fmMap to work correctly, it must be linked to your solution via an External Data Source (or 'File Reference') from your solution to fmMap. fmMap doesn't need to have any file references to your solution.

Step 1. Copy files into correct location.

Copy fmMap.fp7 and SampleContacts.fp7 to the same location as the database to which they are being stitched. All files should be next to each other and in the same folder as your solution. (You'll get rid of SampleContacts.fp7 eventually, but it helps to have that file there for now.) For instance, it might look like this:

Step 2. Add a file reference to fmMap

From within your solution, add an external data source/file reference to fmMap, called "fmMap".

Step 3. Add scripts

The easiest way to get started here is to go to the SampleContacts.fp7 file and copy the four example scripts from SampleContact.fp7, and then paste them (or import them) into your own contacts database. Add the following scripts:

  • Open fmMap
  • Create Map One Record
  • Create Map Foundset
  • Create Directions

Tick off the checkbox to display these scripts in your menu.

Step 4. Edit scripts

Before you edit scripts, make sure you have two fields available within your contacts table (you can actually name them whatever you want):

  • AddressOneLine
  • Label

The AddressOneLine will be a calculation set to something like the following:

  
  Street & ", " & City & ", " & State Province & " " & Postal Code & " " & Country

The point is to have a one-line address, with no interstitial carriage returns.

The Label will also be a calculation, but there's much more variety possible here. The only restrictions are that it needs to be valid HTML and must not contain any carriage returns. This doesn't mean that you can't use the <b> tag within your calculation to insert carriage returns on the output side. A sample calculation might be the following (whitespace added for clarity):

  
  Substitute(
  "<b>" & Contacts::Full Name & "</b><br>" &
  Contacts::Street & "<br>" &
  Contacts::City & ", " & Contacts::State Province
  ;¶;" ")

The Open fmMap script should be fine

The Create Map One Record script will need to be modified to pass the address and label of your address record. You need to modify the parameter for the Perform Script["map.setAddresses ( addresses )"] script step. Out of the box, it's set to Contacts::AddressOneLine. You should change it a one-line address for your contact--the actual AddressOneLine field that you created at the top of this step. The other script parameter to modify is the Perform Script["map.setLabels ( labels )"] script step, which defaults to Contacts::Label. If you have a label calculated, you can use it here. Otherwise, you can leave the parameter blank, in which case the label will default to the address.

The Create Map Foundset script is similar to the Create Map One Record script, except that you're looping through a found set of records to build carriage-return separated lists of addresses and labels. The important lines are the Set Variable [$addressList] and Set Variable [$labelList] steps. Substitute the default calculations with address and label references from your file (hint: they will be the same fields you used in the Create Map One Record config). In both cases, each address and label should contain no carriage returns. Carriage returns are used in fmMap to delimit between the different points on the map.

The Create Directions script is similar to the above. You will need to modify the parameter for the Perform Script ["directions.setAddress ( addresses )"] script step. By default it's set to $startingAddress & ¶ & Contacts::AddressOneLine. You will replace Contacts::AddressOneLine with your own one-line address field reference. It will be the same field you used above.

Step 9. Map away...

1. Start with a small found set of your contact records.
2. Run one of the "Map" or "Directions" scripts.
3. Now, grab a nice cold drink and read the rest of this documentation!