Skip to main content
Liaison

Combine Several Inquiry Form Responses into a Single Merge Field

Through the Inquiry Portal in Outcomes, you can design forms to collect responses from recruits and other interested individuals. When sending messages to people who have completed your inquiry forms, you may want to include merge fields that display information from their inquiry form responses. For example, you may want to confirm a respondent's program of interest, tour date, or another selection they made.

In some situations, it is useful to combine two or more inquiry responses creating a single field that can be included as a merge field in your messages. For example, your inquiry form may ask respondents to select all of the programs they are interested in, and you may want to confirm these in an email to them. Or, if you've asked them to select a start term and year, you might want to concatenate these responses into a single field.

Using this configuration, you can select the fields you'd like to combine, and have them merged into a single field available to include in merges. The steps to complete this configuration are as follows:

  1. Determine which inquiry form fields need to be combined and find the corresponding field keys.
  2. Build a contact property using JavaScript to combine the fields. This JavaScript will reference the field keys from step 1.
  3. Create an email or email template that includes the contact property as a merge field.

Building the Contact Property

Outcomes allows you to build your own fields on contact records called Contact Properties. These can be configured using JavaScript. For this configuration, you'll build a Contact Property that combines multiple inquiry form fields.

To build the new property:

  1. Open the Contacts area of the Settings Menu and click Contact Types.
  2. Click the Contact Type that you are working with.
  3. Any existing Contact Properties are listed In the Contact Properties area. Click Add Property to begin adding a new property.
  4. In the Add Property window, select Single Line (Calculated) from the dropdown. This opens an Expression field.
  5. In the Expression field, add the following JavaScript snippet. (Click the view source icon at the top right to copy the code.)
{
  if(source?.yourfieldkey1 != null){
    return source?.yourfieldkey1;
  }
  else if (source?.yourfieldkey2 != null){
    return source?.yourfieldkey2;
  }
  else if (source?.yourfieldkey3 != null){
    return source?.yourfieldkey3;
  }
  else if (source?.yourfieldkey4 != null){
    return source?.yourfieldkey4;
  }
  else if (source?.yourfieldkey5 != null){
    return source?.yourfieldkey5;
  }
  else if (source?.yourfieldkey6 != null){
    return source?.yourfieldkey6;
  }
  else if (source?.yourfieldkey7 != null){
    return source?.yourfieldkey7;
  }
  else{
    return "";
  }
}
  1. Modify the code to include the fields that you need to include. To do so:
    • Replace the example field keys (e.g., yourfieldkey1, yourfieldkey2, etc.) with field keys that correspond with the fields you want to include. You can find these keys by reviewing the related forms in your instance of Outcomes.
    • If needed, add or remove lines so that your code snippet includes only includes an else if statement for each of the fields you want to include.
  2. Enter a field key for your contact property in the Key field on the right. You'll later use this key as a merge field in your emails.
  3. Click Add at the bottom of the Add Property Window. Then click Save Changes on the Contact Type page.

After adding the new property, you can use it in your emails and email templates.

Finding the Field Keys

In order for the code to work, you'll need to replace the sample field keys with the actual field keys in from the form you want to use. To find the field keys:

  1. Navigate to your Inquiry Form's settings by clicking Inquiry Forms in the Contacts section of the Settings Menu.
  2. Select the Inquiry Form of your choice.
  3. Locate the question that corresponds with the responses you want to combine, and note its field key.

    Sample Inquiry Form
  4. Continue finding field keys until you have identified all the fields you want to work with. Use these keys in your new Contact Property as described above.

Using the Contact Property as a Merge Field

Once your Contact Property has been created, you can use it as a merge field in emails and email templates. To do so, while creating your email, click Merge tags in the email editor. Find the key you used when creating your contact property from the merge tags list.

Adding a merge tag

When sent in an email to your contacts, the merge field will populate with their entries for all the fields that were included in the code for your Contact Property.

  • Was this article helpful?