---
category: [Administration & Integrations, Administration & Integrations/Custom Integrations & Apps, Platform and Product Extensions, Platform and Product Extensions/Integration]
keyword: [Extend, Orchestration Builder, Orchestrate, Orchestration]
nav: wcp_docs
parent_url: /wcp_docs/
title: >- 
  Reference: Join Loop
layout: subsection
---

## Purpose

Use this component to match records from a primary dataset with records from 1 or more joining datasets, based on a common key. Matching records or specific values from those records are made available in the loop block for processing.

If one of your datasets contains unusually large records, it's more efficient to use it as the primary set rather than the joining set.

The maximum size for a joining dataset is 500 MB.

See [Reference: JoinResiduals Member Functions](/wcp_docs/wme1665406566483.html) and [Reference: MatchedWith Member Functions](/wcp_docs/rhu1667839736529.html) for details of relevant functions.

You can aggregate data outputs from the loop. For more information, see [Add Aggregations](/wcp_docs/GUID-499f45c0-34ac-4d4e-8d46-f9719549acfe-enHYPHENus.html).

## <a id="section_2"></a>Template Availability

This component is available in these orchestration templates:

-   Synchronous
-   Asynchronous
-   Business Process
-   Home Card
-   Integration System
-   Custom Agent Action


## <a id="section_1"></a>Properties

Provide a meaningful <b>Reference Name</b> for the step as it will appear in your orchestration.

Under the <b>Joined Datasets Configurations</b> heading, select <b>Primary Dataset</b> or <b>Joining Dataset</b> and configure its settings.

The primary dataset is the dataset that's iterated over to drive the loop.

The joining dataset is the dataset that's queried repeatedly to find matching records for each item processed in the primary set.

You can create multiple joins, each with their own keys and joining datasets.

<b>Primary Dataset Configuration</b>

In the <b>Main Configurations</b> section, configure these settings:

-   <b>Output Name</b>: Provide a name for a record from the primary dataset that's made available to the loop block.
-   <b>Iterator</b>: Use Expression Builder to define the primary dataset.
-   <b>Data Iterator Type</b>: Specify the primary dataset's type. When you select the <i>AutoType</i> iterator, Orchestrate determines the iterator type for you and adjusts automatically if that type changes.
-   In the <b>Error Handling</b> section, under the <b>Multiple Match Handling</b> heading, select a <b>Multiple Match Strategy</b> to specify what happens when a record from the primary set has multiple matches in the joining set:

    -   <i>Complete with Error</i>: Stop processing and log an error.
    -   <i>Skip Record</i>: Move on to process the next record.
    -   <i>Use First</i>: Use the first of the matching records.
    -   <i>Use Last</i>: Use the last of the matching records.
    -   <i>Use All</i>: Use all of the matching records.

-   Under the <b>Missing Match Handling</b> heading, select a <b>Missing Match Strategy</b> to specify what happens when a record from the primary dataset finds no match in 1 or more of the joining datasets:

    -   <i>Alternate Processing</i>: The record is passed into the loop block regardless. Use the `isDataDefined` function to check whether a given joining data item is available in the loop block and perform alternate processing if it isn't.
    -   <i>Complete with Error</i>: Stop processing and log an error.
    -   <i>Skip Record</i>: Move on to process the next record.

-   In both the <b>Multiple Match Handling</b> and <b>Missing Match Handling</b> sections, you can use Expression Builder to define a custom log message to associate with a missing match.


<b>Joining Dataset Configuration</b>

In the <b>Main Configurations</b> section, under the <b>Iterator Configurations</b> heading, configure these settings:

-   <b>Primary Dataset Key</b>: Use Expression Builder to specify the key in the primary record you're attempting to match. Example: the third column of a CSV dataset.
-   <b>Iterator</b>: Use Expression Builder to define the joining dataset.
-   <b>Data Iterator Type</b>: Specify the joining dataset's type.
-   <b>Joining Dataset Key</b>: Use Expression Builder to specify the key in the joining record you're attempting to match. Example: a particular JSONPath.
-   Under the <b>Return Value</b> heading,


Under the <b>Return Value</b> heading, use Expression Builder to specify particular values from the joining dataset to be made available in the loop block

