Skip to content

Collections

Philippe Ozil edited this page May 6, 2022 · 5 revisions

These extensions deal with record collections.

Table of content

ℹ️ These components are part of the Apex Formula Evaluator package.


Add or Insert Record

Adds or inserts a record in a list.

Type: Invocable Action

Inputs:

Name Type Description
collection List<SObject> Record list
record SObject Record to be added or inserted
index Integer Optional index in collection

Outputs:

Name Type Description
collection List<SObject> Updated record list

Aggregate Record List

Calculates an aggregate operation (sum, average...) on a list of records.

Type: Invocable Action

Inputs:

Name Type Description
collection List<SObject> Record list
fieldName String The API name of the field on which the aggregate operation is being run. Values of the field must be parseable as Decimal.
operation String The aggregate function that will be used. One of: SUM, AVERAGE, MIN, MAX
defaultValueForNullFields Decimal Default value used when a field is null.

Outputs:

Name Type Description
decimalResult Decimal Aggregate operation result as a Decimal.
stringResult String Aggregate operation result as a String.

Clone Record List

Clones a list of records.

Type: Invocable Action

Inputs:

Name Type Description
collection List<SObject> Record list

Outputs:

Name Type Description
collection List<SObject> Cloned record list

Dedupe Record List

Builds a list of records with unique field values.

Inspired by Adam White & Danny Tilton

Type: Invocable Action

Inputs:

Name Type Description
collection List<SObject> Record list
fieldName String API name of the field that holds the unicity key

Outputs:

Name Type Description
collection List<SObject> Deduped record list

Extract Strings From Records

Extracts specific field values as strings from a list of records.

Type: Invocable Action

Inputs:

Name Type Description
collection List<SObject> Record list
fieldName String Field name
removeDuplicates Boolean Remove duplicates from output
joinDelimiter String Join delimiter used to produce joinedValues output. Defaults to a comma.

Outputs:

Name Type Description
values List<String> List of field values
joinedValues String List of field values joined into a string with joinDelimiter

Filter Records With Formula

ℹ️ Note: This action is part of the Apex Formula Evaluator package.

Filters a list of records with a formula.

Type: Invocable Action

Inputs:

Name Type Description
collection List<SObject> Record list
formula String A formula that will be evaluated against records from the list.
Example: $Record.Name == "Trailblazer Co."

Outputs:

Name Type Description
collection List<SObject> Filtered record list
totalRecordCount Integer Total record count before filtering
filteredRecordCount Integer Filtered record count

Filter Records With Field Value

Filters a list of records with a field matching a value.

Type: Invocable Action

Inputs:

Name Type Description
collection List<SObject> Record list
fieldName String Field name
fieldValue String Field value

Outputs:

Name Type Description
collection List<SObject> Filtered record list
totalRecordCount Integer Total record count before filtering
filteredRecordCount Integer Filtered record count

Get Record at Index

Gets a record at a specific index in a list.

Type: Invocable Action

Inputs:

Name Type Description
collection List<SObject> Record list
index Integer Index in the list

Outputs:

Name Type Description
record SObject Record at the specifed list index

Join Record Lists

Joins two record lists.

Type: Invocable Action

Inputs:

Name Type Description
collection1 List<SObject> First record list
collection2 List<SObject> Second record list

Outputs:

Name Type Description
collection List<SObject> A record list that contains the two input collections

Remove Record

Removes the record at a specific index in a list.

Type: Invocable Action

Inputs:

Name Type Description
collection List<SObject> Record list
index Integer Index in the list

Outputs:

Name Type Description
collection List<SObject> Updated record list

Sort Record List (deprecated)

Sorts a record list with multiple sort keys.

Deprecated: use Flow's native Collection Sort element.

Type: Invocable Action

Inputs:

Name Type Description
collection List<SObject> Record list
sortKeys String Array of objects in JSON format.
Example: [{ "field":"Name", "direction":"asc" }]

Outputs:

Name Type Description
collection List<SObject> Sported record list

Update Record List With Map

Updates a record list based on a map.

Type: Invocable Action

Inputs:

Name Type Description
collection List<SObject> Record list
keyValuePairs String Map of new field values in JSON format.
Example: { "Rating" : "Hot", "NumberOfEmployees": 1000 }

Outputs:

Name Type Description
collection List<SObject> Updated record list