Custom Constituent Data

🚧

These functions do not accept variables as arguments.

As documented in the Language Limitations, the below functions cannot accept variables as arguments. Arguments must be hardcoded in the function calls.

Personalization Dataset (%%CUSTOM_DATASET%% )

{{ custom_dataset.custom_dataset(<slug>, <key>) }}

Custom Datasets

{{ custom_dataset.custom_dataset('datasetslug', 'datasetkey') }} </pre>

Constituent in Group

cons.inConsGroup(<group_id>)

Returns true if the constituent is in the group specified in the argument.

You can find a group's ID by going to the Manage Constituent Groups page, and finding the value under the 'Group ID' header.

Cons Group Membership

{% if cons.inConsGroup(2) %} 
This user is in cons group #2!
{% endif %}

Constituent Custom Field (%%CONS_CUSTOM_FIELD%% )

{{ cons_field.value(<slug>) }} 

Cons Custom Field

{{ cons_field.value('custom-field-name') }}

Custom Signup Form Field

Signup Form Custom Field (%%SIGNUP_FORM_FIELD%% )

{{ signup_form_field.value(<form>, <field>) }}

The arguments passed here are numbers, corresponding to the form's ID and the field's ID. Currently, the easiest way to get those is to create the tag in the personalization tag composer and transpose the arguments.

For example, %%SIGNUP_FORM_FIELD[form=12,field=158]%% would become {{ signup_form_field.value(12, 158) }}.

If a constituent has multiple values for the field, they're returned in a comma delimited string. You can use Twig to break those values into an array, though you'll need to be careful if your data might contain commas.

Your custom signup form field value is:

{{ signup_form_field.value(14, 244) }}
{% set fields = signup_form_field.value(12, 158) | split(", ") %}
You listed the following responses:
{% for field in fields %} 
 - {{ field }} 
{% endfor %}