correlation_keys
Retrieves all source record IDs stored in a table correlation. This is useful for checking which records have already been correlated or for iterating over correlated records.
Syntax
correlation_keys(correlation_name)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| correlation_name | string | Yes | The name of the table correlation to retrieve keys from. |
Returns
Type: list[string]
A list of source record IDs (primary key values) that exist in the specified correlation.
Examples
Getting all correlated source IDs:
correlation_keys("incidents")
Returns a list such as ["INC001", "INC002", "INC003"] containing all source IDs in the "incidents" correlation.
Checking if a record has been correlated:
if([sys_id] in correlation_keys("users"), "Already migrated", "New record")
Determines whether the current record's ID exists in the "users" correlation.
Notes
- This function can only be used during procedure execution. Calling it outside of an execution context raises an error.
- If the specified correlation name does not exist in the project, a
ValueErroris raised. - The returned list contains source-side IDs only. To get the corresponding target IDs, use
correlation_cachefor each source ID. - Table correlations must be configured in the project before this function can be used.
Related Documentation
- Why Use Table Correlations — Overview of table correlations and when to use them
- Filtering Child Records — Using correlations to auto-filter child step extraction
- correlation_cache() — Companion function for looking up individual correlation values
Comments
0 comments
Please sign in to leave a comment.