Hidden fields allow you to add and set a field not seen by end users within a Zephr form.
If you’re using a single Zephr Identity Store and sharing users across multiple sites, adding a hidden field to a registration form is the perfect place to note which site a user is registering on.
Using Hidden Fields
In this example, we’ll add a Hidden Field to a Registration Form, with the information in the Hidden Field relating to the site that a user had registered on. These instructions can be used for adding any hidden field, with the field available to be added to any out-of-the-box Zephr form.
To begin with, set up a Hidden Field within your Zephr User Schema. To do this, navigate to Settings > Identity Management within your Zephr Admin Console, and scroll down User Schema. Click Add Attribute, and fill in the details for the field you wish to keep hidden. For Type, choose the Hidden option. Once complete, click Add Attribute. This attribute is now part of your user schema, and can have data stored against it for each user.
Once you’ve saved the attribute, navigate to UI > Forms. Locate the form you wish to add the field to from the list, or if you’re starting from scratch, click Add Form.
Add any relevant fields required to your form. When you make it to the Fields section, click Add Fields, and choose your new Hidden user attribute from the list.
A modal called Edit Field will appear. In this modal, set the Default Value for this field. This should be the information you wish to have stored against the attribute. So, if the field is meant to state the site a user has registered on, add the name of the site as this Default Value.
Click Save Field.
Save your Registration Form and add it, as required, into your Feature Rules flow. From now on, when a user fills in this form, the field (unseen by end users) will be filled in with the default value.
Viewing information from Hidden Fields
Information added to a user’s profile via hidden fields can not be viewed on their Zephr User Profile within the Identity section of the site. To view this information, you’ll need to download a copy of your user base.
Do this by navigating to Settings > Identity Management and scrolling down to Export User. Click the download button and you will receive a JSON download of your user base. This will include the Hidden Field details for each user, where applicable. This information can also be shared when connecting to third party integrations, such as a CRM.