Skip to content

Configure Hidden Fields

Hidden fields are data values submitted alongside visible questionnaire answers without being shown to the user. They are useful for tracking metadata, campaign sources, and pre-populated values from URL parameters.

1. Add hidden fields in questionnaire metadata

Section titled “1. Add hidden fields in questionnaire metadata”

In Strapi, open your questionnaire and navigate to the Metadata section. Add entries to the hiddenFields repeatable component.

Each hidden field has the following attributes:

Field Type Required Description
name string Yes The field name used when submitting data to the backend
questionId questionId selector No Links to a question ID for value resolution
questionType enum: string, number, list No The data type of the hidden field value

A minimal hidden field only needs a name:

{
"name": "campaignSource"
}

This creates a field called campaignSource that gets submitted with the questionnaire data.

Use questionType to specify the data type when the backend needs type-safe values:

Type Use case
string Text values, campaign IDs, tracking codes
number Numeric values, scores, thresholds
list Array values, multiple selections

Set questionId to reference a specific question in the questionnaire. This allows the hidden field to resolve its value from the answer to that question, useful when you want to submit a computed or transformed version of a visible answer.

5. How hidden fields appear in synced files

Section titled “5. How hidden fields appear in synced files”

After syncing, hidden fields appear in the questionnaire metadata as an object:

hiddenFields: {},

The object contains the configured hidden field entries, keyed by name.

Use case Configuration
Track marketing campaign name: "utm_source", questionType: "string"
Store internal metadata name: "internalPlanId", questionType: "string"
Pre-populate from URL params name: "referralCode", questionType: "string"
Pass computed data name: "riskScore", questionType: "number", linked via questionId

Hidden fields are included in the questionnaire submission payload alongside visible answers. The backend receives them as part of the standard answer set — there is no structural difference between a hidden field and a visible answer in the submission.