|
FAQ>Lists |
|
|
Return the items selected from a List |
|
|
Article #: |
0013 |
|
Contributor: |
Peter Raine |
|
GF version: |
3.05 |
|
Applies to: |
Microsoft Word templates |
|
Last updated: |
June 28, 2001 |
Question
How can I access the item descriptions as they were selected from a List?
Answer
When a user selects items from a List at run time, the results of the selection are inserted into the new document according to the FillPoints that have been set up. You may need to know which items were selected, though. To do this you need to create a reference to the selected items as a collection and iterate over the items.
Click here to view a step-by-step example.
Select an existing List.
e.g.,%[FullNames = Lists.Select('\Knowledge Base', 'Names')]
The Names List has been set up as follows:
You then need to specify whether the user will be able to select one or many items from the List.
e.g.,%[~FullNames.MultiSelectList('Select the members', 1, ', ', ' and ')]
This FillPoint allows the user to select more than one item from the list. The List is displayed in the document at run time as follows:
The following FillPoint creates a reference to the selected items as a collection and returns the item from the position specified:
e.g.,%[FullNames.SelectedItemsCol.Items(3)] will return "Susan".
|
NOTE |
|
You can also reference the selected results as a collection using the SelectedResultsCol task. See the GhostFill Scripting Language Guide. |