To retrieve data from certain instances of the sub-object that meet a certain criterion, rather than all instances of the sub-object, you must use the qualifier attribute with tc:loop. Again, you must also nest the tc:data tag within the tc:loop tag.
For example, you can use this method to retrieve data only from assignees that have the role Supervisor within a project record. If one or more assignees are found to match your qualifier, their data will be retrieved and inserted in the generated document. The Document Generator will automatically retrieve data only from those records that match the criterion, whether there are zero, one, or multiple records that match.
Caution: The qualifier attribute can only handle one qualifier.
For most sub-objects, the Type attribute is the most useful characteristic for filtering the data that is retrieved. For assignees, the role is actually the Type attribute of the assignee sub-object in the Object Model.
It is possible to use other object attributes from the sub-object, such as a number or text field, but these values are rarely useful for setting a criterion for which sub-objects to retrieve.
The following table indicates the tags and attributes that you would use to set up a tc:loop that retrieves a qualified list of sub-object data in a document template.
Usage of tc:loop - Retrieving Data with Qualifier
Tag attribute |
Attribute value |
Description |
select |
"SubObjectList" |
For the value of the select attribute, type the name of the object attribute that links to the desired sub-object. For example, if you want the Assignees sub-object for a Project, type AssigneeList. See Object Model: Read This First and the additional reference tables it points to, for a complete list of sub-objects and to find the object attribute names that identify them. Note: The tc:data tag must be nested within the tc:loop tag in order to retrieve any data. |
qualifier |
"PathToQualifier=Value" |
•PathToQualifier is a path of object attributes, separated by underscores, that qualifies the sub-object list. This path is built according to the logic of the Object Model. The last object attribute in this path must be of one of the following data types: ointeger ostring odate For example, you can use the type of the sub-object as a qualifier by typing Type_TreePosition for PathToQualifier. The data types can be found in the Object Model: Read This First and related tables. •Value is the data that must exist in the selected attribute in order for the Document Generator to retrieve that instance of the sub-object. If the value does not match the value that you specify, the sub-object will not be retrieved. See Qualifier Tag Attribute Syntax for details about the value of this attribute. Note: The Value can be a ; delimited string to provide OR logic. However, only one instance of the sub-object will be returned, rather than all matching instances. |