Add a Field to a Form

Adding a field to a registration or profile form allows that data to be collected on the form (assuming it passes any associated validations specified in the field definition).

1. Find or Create a Field

  1. Determine if the field that you want to add to your form is defined in the flow:
    1. GET the list of fields available for your flow.
    2. If the field is defined, GET the field definition and verify that the schemaId matches where you want the data to be stored in the database.
    3. If the correct field definition is not in the flow, follow the instructions in Add a Custom Field to the Flow.
  2. Note the name from the field definition.

2. Add the Field to the Form

  1. GET the definition of the form to which you want to add your field.
  2. Update the fields array to include your new field:
  3. PUT the updated form definition into the flow.

3. Update UI

  1. Update your UI to include the new field on the desired form.
  2. If you are using the Janrain Registration widget, add a JTL tag for the new field nested within the JTL tags for the form. JTL tags are template tags that use the following syntax: {* fieldName *}
  3. If you are using a custom UI, ensure the new input element name matches the name of the field that was added to the form.