JOIN_OBJECT_CONNECTION
Description
Returns records from a specified object through a named connection or a related connection, filtered by joining field-value pairs, with an optional additional filtering clause.
Syntax
JOIN_OBJECT_CONNECTION(connection_name, object_name, ...[joining_field_name, joining_field_value], additional_clause_optional)
Parameters
| Parameter | Data Type | Required | Description |
|---|---|---|---|
| connection_name | String | Yes | The name of the connection used to retrieve records, which can be either a named connection or a related connection. |
| object_name | String | Yes | The name of the object from which records are retrieved. |
| … joining_field_name | String | No | The field name to match for filtering records. Multiple pairs allowed. Left Join if any pairs are included; Cross Join if all are omitted. |
| … joining_field_value | Object | No | The field value used as a filter criterion. |
| additional_clause_optional | String | No | An additional query clause for more specific filtering. |
Examples
JOIN_OBJECT_CONNECTION(
"Current",
"Opportunity",
"AccountId", Id,
"IsClosed = true"
)
-- Fetches Opportunities from the "Current" connection where AccountId equals the current record’s Id, further filtered to IsClosed = trueJOIN_OBJECT_CONNECTION(
"$Source",
"Opportunity",
"AccountId", Id,
"IsClosed = true"
)
-- Fetches Opportunities from the $Source connection where AccountId equals the current record’s Id, further filtered to IsClosed = trueJOIN_OBJECT_CONNECTION(
"$Target",
"Opportunity",
"AccountId", Id,
"OwnerId", OwnerId,
"FiscalYear = 2024"
)
-- Fetches Opportunities from the $Target connection where AccountId and OwnerId equals the current record’s Id and OwnerId, further filtered to FiscalYear = 2024.Tips
Defines this function during the Scoping stage to retrieve and prepare data for subsequent use in the Mapping stage.
Be careful to provide joining pairs when using this function. Omitting joining criteria can result in cross joins, creating excessively large record sets. Follow Salesforce best practices to prevent exceeding system limits.