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

Email Designer and Loops and Filters


In release 2015 R2, the feature called Email Template Editor was renamed Email Designer.

Contact your Customer Success Manager to upgrade to the latest release of CPQ Cloud.

Loops are used in the Email Designer editor 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 Table row and configured to loop over Model Line Items, then a new row will be created in the output for each Model Line Item that is present on the Transaction. Attribute values in each row in the output will correspond to a different Model Line Item on the Transaction, effectively creating a new Table row in the output for each Model on the Transaction.

ClosedCreating a Loop

To add a Loop to a Text Element or Table Row 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 Filters section.
  7. Click OK to save the Loop.

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

ClosedEditing a Loop

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


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.


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


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.


  • Yes
  • No


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 Filters section.

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. In an Email Designer template, the only scenario where this is possible is if a Loop is applied to a Text Element that is inside a Table Row that has a Loop applied to it. The "outer"Loop on the Table Row must loop over either All Line Items or Model Line Items in order for the Text Element's Loop to loop over a Configuration Array Set.

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.

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

  4. Click OK to save the Loop.

ClosedAttribute Values and Text Elements in a Loop

Configuration attribute values can be added to Text Elements that have a Loop over All Line Items or Model Line Items, or are within a Table row that has a Loop over All Line Items or Model Line Items.

ClosedTable Row Looping

Adding a Loop to a Row allows for iterating over Line Items in a Transaction. If a Loop has already been applied to the selected Row, the button is labeled Edit Loop.

  1. Click . A Loop dialog box appears where the items that are looped on can be selected.

  2. Loop On the following drop-down items:
  3. Sort By Sub Document (Line Level) Attribute to determine which output Rows will repeat for each Line Item. The Sort By drop-down auto-suggests available Attributes as you type.
  4. Select a Sort Type from the drop-down: 
  5. Choose Yes or No from the Boolean available to Filter the Loop items. The default value is No.
  6. Click Save to save the selections and close the dialog box.

    The following icon appears in the header bar of Rows with a Loop:

  7. Click Cancel to close the dialog box and discard any changes made after the dialog box was opened.
  8. Click Delete Loop to delete the Loop from the Row. This action only appears on already-existing Loops.


Physically, filtering refers to removing some of the contents from a group of items.  You can filter your pool’s water, for example, to remove larger items like leaves.  Or you can filter through your photos and remove the ones that are blurry.

In CPQ Cloud, filtering removes data from the output so that what appears meets criteria that you define.

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

  1. Open the Loop.
  2. For Filter, click Yes.

    The Filter pane appears in the Loop window.

  3. Begin typing Filter conditions. As you type, a combination of literal values, operators, Sub Document Attributes, Main Document Attributes, and Configuration Attributes will be suggested. When the desired component is suggested in the list, click on it to add it to the Filter.

  4. Continuing adding components to the Filter until the condition is logically complete.

    In this example, a line item will only be looped over if its value for the Sub Document Discount attribute is greater than zero.

  5. Click OK to save the Filter and the Loop.

Configuration attributes cannot be used in a Filter if the Loop is set to loop over Part Line Items.



Related Topics Link IconSee Also