Documentation Index

Fetch the complete documentation index at: https://knowledge.technolutions.net/llms.txt

Use this file to discover all available pages before exploring further.

Collecting Custom Addresses on Forms

Prev Next

A Form can collect an address that's not the mailing or permanent address of an individual. Examples include the address of an emergency contact, a birthplace, or the location of a previous employer. Slate offers two ways to store that address, and the method you choose determines how the data behaves afterward.

The options described in this article collect additional address types or store address components in custom fields. To collect a standard permanent or mailing address in the Slate-hosted application, use an embedded Address Widget-scoped form as described in Custom Personal Background Page.

🔑 Required permissions

  • Database: Create the address type prompt or the custom address fields.

  • Forms or Forms (edit all users): Create and edit the form.

Choose a method

Both methods place a single address widget on the form. They differ in where Slate stores the submitted address.

Use a custom address type when the address is a place you can reach the person. Slate saves the address to the Contact/Address table on the person or dataset record alongside the mailing and permanent addresses. The address is available from the Address query base and ranked in its own type. Setup is one prompt value.

Use custom address fields when any of the following is true:

  • The address describes something rather than locating someone, such as a birthplace.

  • The data needs field-level permissions.

  • The address belongs with a group of related custom fields, such as the name, relationship, and address of an emergency contact.

  • The data must be application-scoped.

Setup is five custom fields.

Collect the address as a custom address type

Add the address type prompt

📝 Note: these steps change if the address_type prompt key doesn't exist in your database

If your database doesn't already have a prompt key called address_type, follow the instructions in Customizing Prompts for Standard Fields to add a new address type instead.

  1. Go to DatabasePrompts.

  2. Select the address_type prompt key.

  3. Select New Prompt.

  4. Configure the following settings:

    • Value: The name of the address type, such as Emergency Address.

    • Index Value: A unique value of 16 characters or fewer, such as emergency.

  5. Select Save.

💡 Tip

New prompt values become available on forms after the cache refreshes, about every five minutes. To use them right away, go to DatabasePrompts and select the force-refresh link.

Add the address to the form

  1. Go to Forms.

  2. Create a new form or select an existing form.

  3. Select Edit Form.

  4. Drag a Section Break onto the form.

  5. Under the section break, drag a Street Address block onto the form. Map it to AddressAddress Block, enter a name, and select Save.

  6. Add a Select List and map it to AddressAddress Type. Set Default Value to the new address type, set the field to Hidden, enter a name, and select Save.

  7. Drag a second Section Break onto the form, below the address fields.

The section breaks group the address block with its address type. Set the select list to Hidden so respondents can't change the type. If respondents should choose the type themselves, leave the field visible.

Test the form

Submit the form for a test record. Confirm that the address appears in the Contact/Address section of the person record with the expected type.

Collect the address in custom fields

Create the custom fields

Slate recognizes custom fields with IDs that end in _street, _city, _region, _postal, and _country. When the export key of an address widget matches the part of the ID before those endings, Slate routes each part of the submitted address to the matching field. You can't map the parts of an address widget to fields individually, so this naming is what sends each value to the right place. Choose one stem and use it for all five fields.

  1. Go to DatabaseFields.

  2. Select New Field.

  3. Create five fields using one stem for the Field ID, such as emergency_address:

    • emergency_address_street

    • emergency_address_city

    • emergency_address_region

    • emergency_address_postal

    • emergency_address_country

    Field IDs must not contain spaces or special characters other than an underscore.

  4. Set the Scope to match the data you collect. Person-scoped fields store one address for each person record. Application-scoped fields store one address for each application.

  5. Set the Field Type for each field:

    • Street, City, and Postal: Free Text

    • Region: Single Value, using the pre-built state prompt

    • Country: Single Value, using the pre-built country prompt

📝 Note: the state prompt isn't limited to the United States

When you bind the field to an address widget, the list updates to the regions of the selected country.

💡 Tip

New fields become available on forms after the cache refreshes, about every five minutes. To use them right away, go to DatabaseFields and select the force-refresh link.

Add the address to the form

  1. Go to Forms.

  2. Create a new form or select an existing form.

  3. Select Edit Form.

  4. Drag a Street Address widget onto the form from the form palette.

  5. Leave the System Field list blank.

  6. In the Export Key setting, enter sys:field: followed by the stem. In this example, the export key is sys:field:emergency_address. For application-scoped fields, use sys:app:emergency_address.

  7. Select Save.

Test the form

Submit the form for a test record. Confirm that each part of the address saved to the matching custom field.

📖 See also: Customizing Prompts for Standard Fields

📖 See also: Prompts

📖 See also: Form Palette

Still looking for what you need?