Collections

Collections are a structural element you can use to group fields together so they can be repeated as a set. To use a collection, drag it onto the canvas and then drag fields into the collection.

Example: You want to gather the name, age, and gender of each of the form submitter's children. By placing these fields into a collection, the person filling out the form can click an "Add" button to input the name, age, and gender of more than one child.

Add link in a collection

Settings

To edit a collection

  1. Select the field on the canvas, and the options will appear in the right pane.
  2. Under Field label, enter the field label that will appear next to the field on the form.
  3. Under Variable, specify a name for the field variable associated with this field. If you do not specify a variable name, Forms will automatically assign the field one based on its label.
  4. Under Text Above Field and Text Below Field, you can enter any additional text that should appear with the field. Click the Insert Variables button to include a variable with this text.
  5. Under Set deletion, select Confirm deletion to display a confirmation dialog when a user attempts to delete a set.
  6. Under Collection View Settings, the following options are available:
    • Select Enable pagination to set the Pagination Page Size and control the number of sets displayed at one time.
    • Select Enable search to allow the user to search for data within the collection. The sets displayed will be limited to sets that contain data matching the entered parameter.
    • Select Enable filter to allow the collection data to be filtered through a custom filter dialog.
  7. To configure advanced options, click the Advanced tab.
    • Under Set Settings, select how the collection will control the number of sets and how the sets can be added to the collection.
      • Select Range of sets to specify that the collection can have a minimum and/or maximum number of sets.
      • Select Fixed number of sets to specify exactly how many sets the collection will contain.
      • Select Append sets to the sets populated by a data source or variable to specify how many sets can be added to the existing collection, and set a maximum number of sets if desired.
      • For the range of and append sets options, you may also change the Text for Add Set Link.
    • Under Tooltip, specify the help text that will appear when users hover over the field. Click the Insert Variables button to include a variable with this text.
    • Under CSS classes, specify the CSS classes to assign this field. Learn more about using CSS.
    • To configure field specific rules, click the Rules tab.
    • Your field changes will be applied to the form automatically.

    Note: The labels, tooltip, text above, and text below settings support the use of simple HTML markup for formatting purposes.

  1. Select the collection on the canvas and click Edit in Classic Form Designer, in Form Designer the options will appear in the right pane once selected.
  2. Under Field label, enter the name that will appear above the collection on the form. Click Insert variables to insert a variable in the label.

    Note: The header for a collection in a form is an h2 header, not an h1 header. Only the header of the form can be an h1 header.

  3. Under Variable, specify a name for the field variable associated with this field. If you do not specify a variable name, Laserfiche will automatically assign the field one based on its label.

    Tip: If you added this collection as a variable from another form, and then edited the original collection by adding more fields, you can add those extra fields to this collection by clicking Add a field from variable.

  4. Under Text above field and Text below field, you can enter any additional text that should appear with the field. Click the Insert Variables button to include a variable with this text.
  5. Under Collection options for Classic Form Designer or the Advanced tab for Form Designer, you can choose if a collection will have a fixed number of sets or if users can add sets.
    • Range of sets: Select this option to allow the collection to have a range of sets. This option is helpful in the following situations
      •  If you want the collection to have a set minimum number of sets and then allow users add up to a maximum number of sets.
      • If the collection is being populated with data from a data source or a variable, then you might not know the exact number of sets being populated, so setting a range allows for some flexibility. In this situation, the minimum number of sets specified will always be displayed, even if you don't have enough values from the data source or variable to fill them (blank sets will be added until the minimum is reached). Users can always manually add sets up to the maximum number specified. If the number of sets returned by the data source or variable is the maximum number of sets or higher, the number of sets will be capped at the maximum, and users won't be able to add sets.
      • Tip: Leave the maximum value blank to return all sets from the data source or variable, or to let users add an unlimited number of sets.

    • Fixed number of sets: Select this option to specify the number of sets in the collection. If the collection is being populated from a data source or variable, the results will be capped at this number of sets. If fewer than this number of sets are returned from a data source or variable, the remaining sets will be left blank. Users cannot add sets with this option.
    • Append sets to the sets populated by a data source or variable: Select this option if you want to return all sets from a data source or variable and then append sets to the bottom of that list. In the Min text box, specify the number of sets that will be automatically added to whatever sets are returned by the data source or variable. In the Max text box, specify the total number of sets that can be added to the sets returned by the data source or variable. Users will be able to add up to this number of sets by clicking the link for adding sets. Set both these numbers to zero if you only want to display all the lookup or variable results and not let users add to the collection.
  6. If you had selected Range of sets or Append sets to the sets populated by a data source or variable in the previous step, you can also edit the text that appears on the button for adding more sets. Do this by editing the text under Text for add set link.
  7. To configure advanced options, click the Advanced tab.
    • Under CSS class, specify a CSS class to assign this collection.
  8. In Classic mode, when you are finished editing the settings, click Done. Your changes will be saved automatically.

Collections and variables

When you add an existing field to a collection, the field will lose its variable. Since a collection is a set of repeatable fields, the collection itself will have a variable with sub-values for the fields it contains.

Note:The Save to Repository service task supports process variables that can retrieve values from a specific row in a table or a set in a collection that can be used in a document name or template field. For example, suppose you design a table with a Single Line field and a File Upload field. If the table has 2 rows of values, setting the file upload document name in the Save to Repository service task to {/dataset/Table_variable_name/Single_Line_variable_name[Row()]} will cause the first file to use the first row's value and the second file to use the second row's value.

For an example that uses this feature across process automation, see the Migrating Laserfiche Form Tables into Microsoft Word Documents whitepaper.