You are here:
Joining List Objects
You can use correlation in reports where you need to print additional information in a list, using information from two lists.
Required Editions
| Available in Lightning Experience in Enterprise and Unlimited Editions that have Consumer Goods Cloud enabled. |
The correlation element creates the rows for a table
based on the iteration over the List Object (LO) that is set in the value attribute. This
element matches up the list object used in the <each> node with another LO.
The rows to be inserted are determined by the condition correlationLI[correlationKey] === eachListLI[key].
The supported attributes are:
| Attribute | Description | Data Type | Required |
|---|---|---|---|
| name | Unique name of correlation tag. | String | Yes |
| value | Contains a binding that resolves to an LO. | String | Yes |
| key | Property of the list item in the each tag to compare with. | String | Yes |
| correlationKey | Property of the list item in the correlation to compare with. | String | Yes |
Supports the same child elements as the each node.
Example When the print engine executes the binding
{{Declarations::order.loSdoConditions}}, the list items with pkey are compared
with the correlationKey="sdoItemPKey". The bindings
{{path=.text1}} {{.conditionValue;numberFormat=8.2}}
{{.conditionResult; numberFormat=8.2}} in the correlation section relates to the LO
specified for the correlation node. The extracted additional information about the product is
inserted in the rows below the product name. In addition, the resultant list is filtered based
on the cpIsPrintRelevant
property.<!-- left out details for brevity -->
<tbody>
<each name="itemsEach" value="{{Declarations::order.loPrintItems}}">
<filters>
<filter fieldName="quantity" value="0" operator="GT" compareMode="NUMBER" />
<filter fieldName="movementDirection" value="In" operator="NE" />
</filters>
<orderCriteria>
<orderCriterion fieldName="prdId" direction="ASC" compareMode="NUMBER" />
</orderCriteria>
<tr>
<td>{{.prdId}}</td>
<td>{{.text1}}</td>
<td alignment="center">{{.quantityLogisticUnit; toggleId=DomPrdLogisticUnit;
toggleField=shortText}}</td>
<td alignment="right">{{.quantity}}</td>
<td alignment="right">{{.basePriceReceipt; numberFormat=8.2}}</td>
<td alignment="right">{{.grossValueReceipt; numberFormat=8.2}}</td>
<td alignment="right">{{.valueReceipt; numberFormat=8.2}}</td>
<td alignment="center">{{.taxClassification; toggleId=DomTaxClassification;
toggleField=shortText}}</td>
</tr>
<correlation name="correlation1" value="{{Declarations::order.loSdoConditions}}"
key="pKey" correlationKey="sdoItemPKey">
<filters>
<filter fieldName="sdoItemPKey" value=" " operator="NE" />
<filter fieldName="cpIsPrintRelevant" value="1" operator="EQ" />
</filters>
<tr>
<td />
<td italics="true" colSpan="7">{{path=.text1}} {{.conditionValue;
numberFormat=8.2}} {{.conditionResult; numberFormat=8.2}}</td>
</tr>
</correlation>
</each>
<tr>
<td colSpan="3" alignment="center">{{Labels::TotalId; defaultLabel=Total}}</td>
<td alignment="right">
<sum table="OrderItemsTable" col="3" />
</td>
<td colSpan="2" />
<td alignment="right">
<sum table="OrderItemsTable" col="6" numberFormat="8.2" />
</td>
<td />
</tr>
</tbody>Did this article solve your issue?
Let us know so we can improve!

