Custom Addresses within Forms

It can sometimes be useful to collect a custom address that is not connected to the default permanent or mailing addresses within Slate. This article outlines two possible methods to capture custom address data within a form:

  1. Create a custom address to be stored within the Contact/Address table on the person record.
  2. Store an address to a series of custom fields created within the Fields tool. 
Option 1 - Custom Address Type
Creating a Custom Address Type
  1. Click Database in the top navigation bar and select Prompts.
  2. Click Insert.
  3. Enter the following configurations in the popup window:
    • Key - 'address_type'
    • Value - Enter the text that corresponds to the address type you wish to collect. In this example, we will create an address type for the emergency address. The Value would be 'Emergency Address'.
    • Index Value - Set a unique Index Value setting.

      emergency_address.png

  4. Similarly, you will need to create additional address_type prompts for your existing Permanent and Mailing addresses.
Using the New Address Type on a Form
  1. Within your form, drag-and-drop a Section Break
  2. Underneath the Section Break, drag-and-drop a Street Address block and map this field to Address > Address Block, set a name and click Save
  3. Add a Select List element and map this to Address > Address Type. Set the Default Value to your new Address Type, set the field to Hidden, set a name, and click Save
  4. Insert a second Section Break

Once the form is complete, submit the form for a test record, to ensure the address saves to the Contact/Address section of the person record.

Option 2 - Custom Address Fields
Creating Address Fields
  1. Click Database in the top navigation bar and select Fields.
  2. Click Insert to begin creating the custom fields.
  3. Create five new custom fields to store the address data. Fields will be needed for:
    • Street
    • City
    • Region
    • Postal
    • Country
  4. The naming convention for these fields must all be consistent. The beginning of each field ID is customizable but should be computer-friendly (no spaces, capital letters, or special characters other than an underscore). In the following example, the first part of the IDs were defined as 'emergency' The field IDs should all be appended with '_address_{{address part}}':
    • emergency_address_street
    • emergency_address_city
    • emergency_address_region
    • emergency_address_postal
    • emergency_address_country
  5. Pay close attention to the Value setting (Store Value versus Store Prompt ID) for each field. The Country field should use the pre-built 'country' prompt. The Region field should be set to use the pre-built 'state' prompt.
Configuring the Address Block in a Form
  1. Navigate to the Forms tool in the top navigation bar.
  2. Create a new form or select an existing form.
  3. Click Edit Form in the right-hand side menu.
  4. Drag in a Street Address widget onto the form from the form fields palette.
  5. Within the Export Key setting, manually enter the export key to link the address widget with the new custom fields. For this example, the export key would be 'sys:field:emergency_address'.  For application-scoped fields, the export key for this example would be 'sys:app:emergency_address'.
Was this article helpful?
2 out of 2 found this helpful