Tip>Designer

Using Clauses in multiselect Lists

 

Article #:

0008

Contributor:

Gillian Scott

GF version:

All

Applies to:

Clauses in Lists

Last updated:

June 19, 2001

Description

Insert a Clause into a document for each selection a user makes from a List in a Dialog.

Explanation

The results in a List are set up to correspond to specific Clauses. The selection that the user makes from the List is then referenced as a collection. The ForEachBlock task is used to iterate over this collection and an appropriate Clause is inserted for each item selected.

 

Click here to view a step-by-step example.

To set up this sequence of events do the following:

  1. Create a List in the GhostFill List Editor. Set the result for each item to a suitable identifier:

 

  1. Create a Clause (all in the same folder) for each item/result pair in the List. The Clause names must correspond to the identifiers in the results, i.e. each Clause must have the same name as the appropriate identifier in the List:

 

  1. When you add your List to a Dialog, allow the user to select multiple list items (e.g., a Multiselect list box or Multiselect check boxes):

 

  1. Insert the following FillPoints into your template (where "Medical.Records" is a multiselect list in a Dialog and "\Knowledge Base" is the folder containing the Clauses):

%[Materials=Lists.CSVToCol(Medical.Records)]%[ForEachBlock('Record',Materials)]

%[Clauses.Select('\Knowledge Base',Record)]

%[EndBlock()]

At run time the user will make a selection from the Medical.Records list and based on this selection the relevant Clauses from the Knowledge Base folder will be inserted into the document.

Template Example