Using Sample Form Snippets

You can use sample form snippets to easily add commonly used form fields.

  1. Log into your Spoke Phone account portal online.
  2. Go to Other > Developers > Form Definitions.
  3. Click +Add custom form.
  4. Add a form name, description and form reference.
  5. Scroll down the page and Select Insert form template or snippet.
  6. Scroll to or search for the snippet named Option List.
  7. Click anywhere within the row of Option List to load the form preview on the right.
  8. Select the mceclip0.png icon to the right of the snippet description to add to your form.
  9. The snippet is added into your form.
    HINT: Form snippets are stacked onto the bottom of your existing form.
  10. Click save.

Form customization

Once you have a snippet in place, you will want to edit the form fields to suit your needs.

  1. In the Form Data Definition, after adding the snippet, you can see the line properties:
    This is the root that must exist in all forms.
  2. Following that, you should now see the line string-enum:
    This is the 'field' name definition.  This defines the data object name that will be used for this field.
  3. Edit the option values after enum: . Each option must have '- ' (hyphen and space) leading it.
    These lines declare the text string option values presented to the user.  The selected option will be submitted with the form as the data object value.
  4. Add a fourth option by following the same pattern.
    Note: Spacing and format is important, follow the same pattern carefully.
  5. In the Form Display Definition you can add a title, help message and description to the field.
  6. Edit the text following 'ui:title': to change the field title.
  7. Add a new line with 'ui:help': Help me to add help text for the field.
  8. Add a new line with 'ui:description': An introductory description of the field.
    Note: indentation is important.  The title, help and description declarations need to be indented 2 spaces from the field name.
  9. Click save.
  10. Test the form using test draft forms in the Spoke Phone App.

 

Next steps

Was this article helpful?
1 out of 1 found this helpful