How to Validate the input felids in Flow
1

I need to create a template with Flow option for Registration. But, I need to validate number field and Date Picker Field in that. Number Field should be 10 digits and Date Picker Field is a DoB the Age of user should be grater than 10.

Coitor
Asked about 5 months ago
Selected Answer
1

You have two options: 1. Set hard-coded validations in your Flow JSON definition 2. Set up an Endpoint for your Flow, and validate server-side

Set hard-coded validations in your Flow JSON definition This is by far the easier method, and should get you the functionality you want. * For the number field, you can set the min-chars and max-chars of the component to 10 * For the Date Picker field, you can set the min-date property such that users can't set a date younger than 10 years. (Note that there are currently some nuances with the way the DatePicker components works, so please read the guidelines for use).

Set up an Endpoint for your Flow, and validate server-side This solution is more complex to set up, but gives you more control. I'd recommend against this unless you absolutely need the added control.

  • Adding an Endpoint to your Flow allows you to execute data exchanges between your Flow and your server while the user is using the Flows. This allows you to react to user input and control the experiences in real-time.
  • Setting up an Endpoint requires some work and maintenance
  • Once you have your Endpoint set up, once the user enters the information on the screen, you can perform a data_exchange and validate the entered data on your server, and display the relevant errors back to the user.
  • Note that even if you proceed with this method, it's best to also include the static validation in the first option described above, so the user gets more immediate feedback about their input.
July 16 at 1:21 AM
Bar