Build a ‘formatted list’ from a Repeat Section with a built-in system function (BuildList)

How to make a Formatted List: Bob, Mary, Jane and David.

Documents sometimes require a number of items to be formatted as a list. For example, when entering multiple individuals for a document you may want them to be displayed like the following, Bob, Mary, Jane and David. Because you don’t know how many items the user may need to enter this may seem to be quite a challenge.

ZumeForms provides a special system function to do this automatically with a very simple Script.

Function: $(this).BuildList()

BuildList() is a function that you use in form script. You put this function into the Script of the source-Form Field that the User will enter the items into. Each time this source-field is updated the BuildList function runs, creating the list value, then putting it into the target-Form Field on the form.

Usage

$(this).BuildList('targetfieldname');

How To

  1. Create a form
  2. Create a Repeat Section
  3. Add a field to the Repeat Section (the ‘source field’)
  4. Add a Field underneath/outside the Repeat Section (the ‘target field’)
  5. Add this script to the source field in the Repeat Section. Where the targetfieldname is the name of the field underneath the Repeat Section.

e.g. $(this).BuildList(‘targetfieldname‘);

Run Form. Add items into your form and see what happens!