Pre-filling and Hiding Fields in OneTrust Hosted and Embedded Web Form Collection Points

Once you have created and built your OneTrust Hosted or Embedded Web Form Collection Point, you can decide which content fields are pre-filled or hidden for the data subjects interacting with your web forms, facilitating the data collection process. You can easily configure pre-filled and hidden fields using a query parameter in the URL.

Things to Know

Pre-filling and Hiding functionalities can be enabled for OneTrust Hosted and Embedded Web Form Collection Points. The following table details each functionality and the corresponding applicable fields.

Functionality

Description

Applicable Fields

Pre-filling via Query Parameter

Note:

Values passed in the URL must be URL-encoded, as shown below:

  • Use UTF-8 encoded value for “+”, which is “%2B”. For example, if the phone number is +1 123 456 7890, then the query parameter passed should be ?Mobile=%2B11234567890.

  • Use the "&" sign to separate each value pair provided in the URL: ?State=Georgia&Louisiana.

You can pre-fill web form fields that will include previous entered information by adding a query parameter at the end of the URL.

  • Pre-filling uses the Form Field Label assigned to Data Elements, Purposes, and Purpose Preferences.

    Note:

    The Form Field Label is available when editing a content field on the Builder tab in the Edit Field section and it can be changed when editing the field on the web form.

  • The same label will then be provided within the query parameter including any of the available options for that content field.

For example, a query parameter of [Communication Channel = Text Message] will pre-fill the field with the label "Communication Channel".

The pre-filling functionality via Query Parameter is applicable to the following content fields:

  • Data Elements (except multi-select choice)

  • Purposes

  • Purpose Preferences

Pre-filling via JavaScript

Note:

Pre-filling via JavaScript code is only applicable to OneTrust Embedded Web Form Collection Points.

You can pre-fill web form fields that will include previously stored known data via JavaScript.

For more information, see Embedded web forms methods and events in the OneTrust Developer Portal.

The pre-filling functionality via JavaScript is applicable to the following content fields:

  • Data Elements

  • Purposes

  • Purpose Preferences

Pre-filling via Remembered Identifiers

Note:

Pre-filling via Remembered Identifiers is only applicable to OneTrust Embedded Web Form Collection Points.

Note:

A CMP license is required to use this functionality.

You can pre-fill web form fields that will include previous stored known data about a user's identity by remembering data subject identifiers.

For more information, see Configuring OneTrust Embedded Web Form Collection Point Settings.

The pre-filling functionality via Remembered Identifiers is applicable to the following content fields:

  • Data Subject Identifiers

Hiding

You can hide web form fields when using any of the pre-fill functionalities enabling the Hide Form Field setting on the Builder tab.

Note:

Take into consideration the following scenarios when pre-filling via query parameter if a query parameter is not provided:

  • Fields with no default value will be shown.

  • Fields with default values will remain hidden.

The hiding functionality is applicable to the following content fields:

  • Non- required Data Elements, Purposes, and Purpose Preferences (except multi-select choice) including emails, phone numbers, etc.

  • Required Data Elements, Purposes, and Purpose Preferences (only if they are single select content fields).

Note:

These functionalities depend on the admin to provide an accurate query parameter on the URL to ensure that unexpected values are not recorded in the receipts, as incorrect query parameters can result in incorrect values being recorded for the data subject’s profile.

Note:

Validation of data applies to hidden and visible fields. If data is invalid, the field will not be pre-filled remaining empty, or it will take the default value.

Use Cases

The following are particular cases of the pre-fill functionality that present some variations:

Configuration

Outcome

Purposes with Purpose Preferences

If a Purpose is pre-filled as checked and it contains required Purpose Preferences, these Purpose Preferences have to be filled.

If a Purpose Preference is pre-filled and the Purpose is not required, the Purpose will remain as not required.

Note:

If a Purpose Preference is intentionally checked, the Purpose will become required.

Country / State content fields

Country and State content fields should be pre-filled using ISO codes.

Date content fields

Date content fields should be pre-filled using ISO codes (YYYY-MM-DD).

Phone Numbers

Phone Numbers have to be filled as shown in the following example (adding %2B instead of the + sign at the beginning). If the phone number is +1 123 456 7890, then the query parameter passed should be: ?Mobile=%2B11234567890.

Visibility Rules

Pre-filled fields will trigger those visibility rules to which they are associated.

Additional Resources