Introduction
You may want to collect additional information about you user, whether it’s a customer’s email, first name, last name, address or other custom fields . You can do this at any stage… pre-signup, at signup,or at any point in the user’s lifecycle. Let’s go through each one in turn. We offer pre-made fields (see note below), or you can create your own.Pre-made fields
Pre-made fields
We have a few fields pre-made for you including Alias, First Name, last Name, Job Title, T-Shirt Size, and username.As an example,Username field is a string that is unique for each project, and has the following validations:
- Letters A-Z, a-z, numbers 0-9, or symbols $ ! # % ?
- Must be length 5 to 20
- Cannot contain consecutive symbols
- T-shirt size - this field is a dropdown with the standard options available (XS, S, M, L, XL, XXL).
Enabling field collection
For all instances, we’ll want to enable the fields we want to collect: Scroll to “Additional User Information” in the Login/User Profile section of the dashboard.
Pre-signup
1
Create
You will want to programmatically create a user in Dynamic and attach this information to them. You can do both steps at the same time, or you can do one after the other.Make an API call to the users endpoint with some form of identifier for the user, and with or without the information you want to capture.
2
Collect
You can now update that user object with more information when you want to, utilizing the update user endpoint:
3
Signup
Now, when the user actually signs up using that same email, we can give the user object a verified credential, and they will be able to see the information you captured on their profile.
During Signup
Once you have enabled the fields you want to collect, the user will automatically be prompted to enter the information during signup!
Post-signup
If fields are mandatory, they cannot be skipped during onboarding and the user will be prompted to enter the information. However, if you have only optional fields, you can skip them during onboarding and prompt for them at a time of your choosing. Then, if you want to prompt the user to enter the information at a later time, you can do so by calling theupdateuserwithmodal
method from the useuserupdaterequest
hook. This will trigger the UI for info capture.