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:
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:
{ 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 ""; } }
After adding the new property, you can use it in your emails and email templates.
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:
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.
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.