You are here: Document Designer > Document Designer and Loops and Filters

Document Designer and Loops and Filters

OVERVIEW

Loops are used in the Document Designer to dynamically expand a section of content by iterating over a set of data. Loops can be added to the following components:

If a Loop is applied to a Section and configured to loop over Model Line Items, then a new Section will be created in the output for each Model Line Item that is present on the Transaction. Attribute values in each Section in the output will correspond to a different Model Line Item on the Transaction, effectively creating a new page or pages in the output for each Model on the Transaction.

ADMINISTRATION

ClosedCreating a Loop

To add a Loop to a Section, Text Element, Table row, or XSL Snippet Elements:

  1. Select the component that the Loop will be added to.
  2. Click the Loop button () in the Dynamic Content Bar.
  3. Select a set of data to loop over from the Loop On drop-down.
  4. Optionally select an attribute to sort by from the Sort By drop-down.
  5. Optionally select a sort type from the Sort Type drop-down.
  6. Optionally add a Filter to the Loop by clicking Yes for Filter. For more information on Filters, see the topic Filters.
  7. Click OK to save the Loop.

    A Loop icon is added to the component in the Template Flow.

    Click the Loop icon on the component, or the Loop button in the Dynamic Content Bar when the component is selected, to modify or delete the Loop.

Property Options Available Required Description

Loop On

  • All Line Items
  • Model Line Items
  • Part Line Items

Yes

The set of Transaction data that will be looped over. Selecting All Line Items means that both Model Line Items and Part Line Items will be looped over.

Sort By

All Sub Document attributes are available to sort by.

No

The Sub Document attribute that determines the order in which looped over data will be displayed in the output. If no attribute is selected, looped over data will appear in the same order as the line items appear on the Transaction.

Sort Type

  • Ascending
  • Descending

No

Determines if the Sub Document attribute being used to sort by will be sorted from lowest value to highest value (ascending) or highest value to lowest value (descending).

If the Sub Document attribute is a Text attribute, ascending will be alphabetical and descending will be reverse-alphabetical.

Filter

  • Yes
  • No

NA

Determines if data will be filtered out and not used in the Loop based on a set of conditions. For more information on Filters, see the topic Filters.


ClosedLooping Over a Configuration Array Set

A Loop must be nested within another Loop in order to loop over each line in a Configuration Array Set. The “outer” Loop must exist on a Section or a Table row, and it must loop over either All Line Items or Model Line Items.

The nested Loop can be created on a Table row, a Text Element, or an XSL Snippet Element. To configure the nested Loop to loop over a Configuration Array Set:

  1. Open the Loop.
  2. Select Configurable Array Sets from the Loop On drop-down.

    The Configurable Array Set field appears.

  1. Select the desired array set from the Configurable Array Set drop-down.

  1. Click OK to save the Loop.

ClosedFilters

In CPQ Cloud, filtering removes data from the output so that what appears meets criteria that you define.  Filtering in a loop enables you to restrict the results returned by a certain criteria.

For example, you might want to filter a Table row that has a Loop applied to it so that only discounted parts are shown in the output.  Without a Filter, the Loop on the table row will repeat the row for every part on the Transaction.  A Filter can be added to the Loop to determine which parts on the Transaction should be looped over.


ClosedAdding a Filter to a Loop

NOTES

RELATED TOPICS

Related Topics Link IconSee Also