Conditions

There are two types of conditions you can insert into templates to condition what data tags retrieve:

  • standalone conditions - you can add them anywhere in the template, they are not dependent on any tags. Standalone conditions are used to control if section of a document will be displayed or not. Conditions are processed after all the other tags have been processed. Using conditions may slow down a performance if large number of conditions are used to determine in the end if one section is displayed or not. On the left side is a tag whose value will be compared and on the right side is list of values to compare with. Values are separated by “|” Conditions always use “OR” logic. To check if value is equal use ”=” and if not equal use ”!”. Typical example of condition is : [CONDITION,<<Q_QP(myproperty)>>=golf|soccer|basketball] Any static text or tables or tags [CONDITION_END].
  • tag-dependent conditions - create a condition by adding :CONDITION() to a tag (for example, <<QUOTE_ITEMS:CONDITION([EQ](<*CTX(Quote.CurrentItem.ProductTypeName)*>,Hardware))>>).

[CONDITION,…] tags do not support table tags (<*Table(SQL query)*>). Also, [CONDITION,…] tags must not be nested.

Conditions are not required in templates. They allow you to retrieve data only when the condition is fulfilled.

:CONDITION Tags

Add these conditions in C2 tags and when retrieving quote products, containers and quote items (main and line items, header and footer).

Tag Conditions

Tag conditions can be applied to every tag to perform an action based on the value the tag returned. Condition tags can be used in both Microsoft Excel and Microsoft Word templates. If there are multiple tags, separate them with |.
For example, if you add this tag to your template, <<Q_BILLTO(COMPANY),ABC=d|XYZ=d|D>>, the system searches for the company of the Bill To user. If the company is ABC or XYZ, the system deletes the name of the company and leaves an empty line in the document. However, if the tag retrieves any other company name, the entire line where the tag is on is deleted.
The available tag conditions are listed below:

  • D - deletes a line.
  • d - deletes the value that the tag returns.
  • P - inserts a page break after the value that the tag retrieves.
  • p - inserts a page break before the value that the tag retrieves.
  • B - makes the entire line bold.
  • b - makes the value that the tag returns bold.
  • U - converts the value to uppercase.
  • DC - deletes the content of the cell, if the value displays in a table cell.
  • DR - deletes the content of the row, if the value is displayed in a table.
  • DCOL - deletes the content of the column in which the value is displayed. Deletion may fail if there are merged cells in the column.
  • DELETE_TABLE - deletes the content of the entire table, if the value is displayed in a table.

More Information

You are here: SAP Sales Cloud CPQ Online HelpAdmin Page HelpQuotes AdministrationDocument GenerationDocument Generation TagsConditions