Item Lists in Document Publisher

Named Item Lists in Document Publisher

When working with large datasets it is sometimes convenient to cache the returned items for re-use in multiple tags. Document Publisher makes this possible using named items lists. These are created from the User Variables dialog.

User Variables Dialog Showing Item List Variable
User Variables Dialog

Creating an Item List

To create an item list you need to:

  1. From an open template select Tools > User Variables
  2. This produces the Variables dialog. Locate the predefined $ItemList entry
  3. Add a new entry in the Value column. This is a comma separated list of all the named item lists in your template
  4. Press OK to save the variable and your item list is now ready to use in a tag

Populating an Item List

Once you have generated a suitably named list you must create a Paragraph Group tag to populate the list.  For further information on how to create a Paragraph Group tag please click here. No output is to be generated from this tag, its sole purpose is to fill the item list for subsequent tags to use.

  1. Create the Paragraph Group tag at an appropriate place in the document, this must appear before the tags which are to use the item list
  2. Within Tag Properties find the Hierarchy property and click … to create a new hierarchy
  3. Edit the hierarchy and set the appropriate item selection(s)
  4. For each node set the Document Section property to <None> so that no output will be generated
  5. Select your newly created item list in the Item List property
  6. If the same list is being filled multiple times then set the Clear Cache property depending on if you want to refill the list from scratch or append to the existing list
  7. Press OK to save the hierarchy
Hierarchy Dialog showing Item List
Hierarchy Dialog

Please note that duplicate items are automatically removed from item lists as they are filled.

Using an Item List

Once a Paragraph Group tag has been setup to fill your item list, it can be used by any tag appearing after it in the template document.

  1. Create a Paragraph Group or Table tag at an appropriate location in your template
  2. Set the tag‘s item selection to match what information is stored in the item list
  3. Optionally, create a hierarchy to follow from the items stored in the list
  4. Optionally, override the Sort By property if it needs to be different from the item list sorting order
  5. Expand the item selection and set the Identity property as shown below, using the special value $ItemList followed by a colon and then the name of the list to use it
Tag properties showing $ItemList
Tag Properties

Referencing an Item List in a Filter

There are two special filter properties that can be used to check for the existence of items stored in an item list. These are available in the Filter dialog as Link Attributes:

  • Exists in Item List – where the filter expression will evaluate to true if the item exists in the named item list
  • Is Linked to Item in Item List – where the filter expression will evaluate to true if the item is linked via a specified link type to an item that exists in a named item list
Database Access Filter Dialog showing $ItemList
Database Access Filter Dialog
Article Updated 04/02/2019 – Incresed image sizes