Add a User Attribute
To add a user attribute, complete the following steps:
- Navigate to Identity > User Attributes > Add a new Attribute.
- Enter a name for the user attribute in the Label text box.
- Select the format used by the user attribute from the Type drop-down options.
You can use a Hidden type to collect information about the end user without the field being visible on their screen. For example, you could use a hidden field to record the site on which the end user registered.
- If you select Selectlist from the Type drop-down menu, select the Add An Option button to add the menu options. To add an option, complete the following steps:
- Enter the heading for the options in the Label text box
- Enter the name of the option in the Value text box
- If you want the option to be selected by default, select the Default checkbox
- Select the Save button to add the option to your Selectlist options or Radio Buttons and return to the Add User Attribute screen. Selecting the Cancel button displays the Add User Attribute screen without saving your changes
- If you select Radio Button from the Type drop-down menu, select the Add An Option button to add the selectable options. The Add Option dialog box displays. Complete the dialog box as described for the Selectlist type.
- If you select Range from the Type drop-down menu, further fields are displayed. To define the valid range, complete the following steps:
- Enter the start of the valid range in the Range Start text box.
- Enter the end of the valid range in the Range End text box.
- Enter the amount by which the valid range increases in the Range Step text box.
Note: You can also use the up and down arrows at the end of the Range Step text box to increment or decrement the step value.
For example, if you enter a Range Start of 1 and a Range End of 10 with a Range Step of 2, the end user can enter 2, 4, 6, 8, or 10. If the Range Step is set to 1, the end user can enter any value between 1 and 10, inclusive.
- Optionally, for all types, enter a description of the user attribute for internal purposes in the Internal description (Optional) text box.
- Optionally, for all types, enter a description of the user attribute to display in the Public description (Optional) text box.
- Optionally, for the Text, Telephone, Email, URL, or Date types, enter the expression against which to validate the entered information in the Validation Expression (Optional) text box.
- For all Types, if the information is required, select the Mandatory field checkbox.
- Mandatory fields must always be completed when a user is created, whether directly on your site by the end user, using the Zephr API or directly in the Admin Console.
- You must include any fields that are defined as mandatory in your registration forms. If you do not want end users to provide the related information in all of your forms, Zephr recommends that you do not select the Mandatory checkbox here; instead, make the field mandatory in any form in which you want to collect the information when you create it.
- Select the source of the user attribute: Internal or External.
- Internal: The attribute is stored and managed within Zephr.
- External: The attribute is retrieved from an external identity system, such as Auth0. To enable the external attributes, the feature flag, feature.externalUserAttributes.enabled, must be enabled in your tenant. You can reach out to Zuora’s Customer Support team to enable this feature for you. If you select External, two additional fields will appear:
- External System: Choose the external identity provider from the drop-down list, for example, Auth0
- Value Path: Enter the JSON path to the attribute in the external system. For example: $.user_metadata.colour_preference
This path tells Zephr where to find the attribute value when a user logs in.
This path will vary depending on how your external identity provider structures user data. The example provided ($.user_metadata.colour_preference) applies to systems like Auth0, where custom attributes are stored in a user_metadata field in a JSON object representing the user.
For more details related to this example, refer to Auth0's documentation on user metadata. However, if you can’t locate the metadata fields or if the Auth0 UI has changed, please contact Auth0 Support directly for assistance.
- To add another user attribute, select the Add another checkbox.
- Select the Save button to save the user attribute. If you selected the Add another checkbox, the Add User Attribute screen displays. You can add another user attribute as described in the steps above. If you did not select the Add another checkbox, the User Attributes screen displays.
The user attributes are listed in the User Attributes screen. The order is reflected in the following places:
- The user’s profile
- The user list
You can reorder the user attributes by dragging them to the required position in the list.