Creating Additional Fields

Additional fields in contact cards store app-specific information about contacts, such as onboarding answers, fitness goals, subscription preferences, important dates, locations, and usage statistics. You can use this data for advanced segmentation and deeper personalization of communications.

Additional Fields Tab

Additional fields are available in the account settings on the Additional fields tab. By default, the account contains only the Personal list with the Birthday and Gender fields.

Additional fields tab in account settings with the Personal list

The additional fields list displays:

  1. Field type, such as text input or date.
  2. Field name.
  3. Variable used for message personalization and as the field key in SDK requests.
  4. Field ID.
  5. Edit field button.
  6. Delete field button.
List of additional fields showing field type, name, variable, ID, and action buttons

You can create lists and add fields to them.

Creating a List

Lists help you group fields by purpose. For example, use Onboarding for information collected during onboarding and Usage statistics for calculated engagement metrics. To create a field list:

  1. Click New list of fields.
New list of fields button in the additional fields settings
  1. Enter the list name.
Input field for entering the name of a new additional fields list
  1. If necessary, change the personalization key generated automatically from the list name. The key is used to build variables for the fields in this list, so choose a short and clear value.
Automatically generated personalization key for an additional fields list
  1. Click Save.
Save button for an additional fields list
šŸ“˜

Note

  • The list remains inactive until you add its first field.
  • Before deleting a list that contains fields, delete all fields from the list.

Adding Fields

  1. Click the plus icon to create a field in the list.
Plus button for adding a new field to a list
  1. Enter the field name and, if necessary, edit the automatically generated personalization key.
Field name input and automatically generated personalization key
  1. Select the field type. Text input is selected by default.
Field type selector with available options

Field Types

Depending on the contact data type, the following field types are available:

  • Text input can contain up to 1,000 characters, including letters and integers. Special characters are not supported. Use this type, for example, to store a user's name, preferred workout, or city.
  • Text area can contain up to 5,000 characters, including letters and integers. Special characters are not supported. Use this type, for example, to store answers to open-ended onboarding questions.
  • Number can contain only integer values from -2147483647 to 2147483647, such as a workout count or the number of completed sessions.
  • Fractional number can contain integers and decimal values, such as an average workout duration or subscription revenue.
  • Date — values must use the ISO 8601 format: YYYY-MM-DD. Use the Regular date option when creating dynamic segments for communication related to recurring events, such as birthdays or membership anniversaries.
Date field settings with the Regular date option for recurring events
  • Date and time — accepted formats are YYYY-MM-DDTHH:mm:ssZ for UTC and YYYY-MM-DDTHH:mm:ss±HH:mm with a UTC offset. Use this type for date-and-time values, such as a trial expiration time or the scheduled start of a training plan.
  • Drop-down list contains predefined values, such as a user's fitness goal, subscription status, or preferred language.
šŸ“˜

Important

Do not use a period (.) in the field name. For example, use Fitness goal or Fitness_goal instead of Fitness.goal.

Drop-down list field with predefined values
  • Checkbox allows you to store multiple selected values.
Checkbox field allowing multiple selected values

Working with Additional Fields via API

Retrieving the Field List

To retrieve additional field lists and their IDs, keys, types, and allowed values, use the Get additional fields method:

GET /api/v1/additionalfields

You can pass the ID returned in additionalFields[].id as fields[].id when adding or updating contacts.

After you create an additional field, synchronization may take up to one hour. Until synchronization is complete, the field may be unavailable through the API.

Updating a Checkbox Field

To write or update a Checkbox field using the Add/update contacts API method, pass the numeric field ID in the fields array. Separate multiple values in the value parameter with commas:

{
  "contacts": [
    {
      "channels": [
        {
          "type": "email",
          "value": "[email protected]"
        }
      ],
      "fields": [
        {
          "id": 87166,
          "value": "Strength training,Yoga"
        }
      ]
    }
  ],
  "dedupeOn": "email",
  "customFieldsIDs": [
    87166
  ]
}

In customFieldsIDs, specify the IDs of the additional fields to update. This parameter is required when updating an existing contact. Only the fields listed in this array are updated.

Updating Additional Fields via SDK

Use contact field variables without the % characters as keys when updating additional fields through the SDK.

Contact field variable without percent characters used as an SDK field key

Android example:

val userAttributes = UserAttributes(
    email = user.email,
    fields = listOf(
        UserCustomField(
            key = "TRAININGAPP.GOAL",
            value = "lose weight"
        )
    )
)

val user = User(userAttributes = userAttributes)

Reteno.instance.setUserAttributes(
    externalUserId = "USER_ID",
    user = user
)

iOS example:

let userAttributes = UserAttributes(
    email: user.email,
    fields: [
        UserCustomField(
            key: "TRAININGAPP.GOAL",
            value: "lose weight"
        )
    ]
)

Reteno.updateUserAttributes(
    externalUserId: "USER_ID",
    userAttributes: userAttributes
)

More About the Mobile SDK →


Did this page help you?