Action.AdditionalAttribute Class

Contains methods to get metadata about attributes associated with invocable action parameters.

Namespace

Invocable

Usage

Additional attributes extend invocable action parameters with custom metadata beyond the standard parameter properties. Use the AdditionalAttribute class to access this extensibility metadata when working with invocable actions.

For type-safe access to collection values, use the typed getter methods such as getValueAsStringList(), getValueAsIntegerList(), getValueAsDoubleList(), or getValueAsBooleanList(). These methods return null when the requested data type doesn't match the attribute's actual data type. Check getDataType() and getIsCollection() before calling typed getters to ensure you use the appropriate method.

Example

1Invocable.Action action = Invocable.Action.createStandardAction('otherActionName');
2List<Invocable.Action.DescribeResult> results = action.getDescribe();
3
4for (Invocable.Action.DescribeResult result : results) {
5    for (Invocable.Action.InputParameter input : result.getInputs()) {
6        List<Invocable.Action.AdditionalAttribute> attrs = input.getAdditionalAttributes();
7        if (attrs != null) {
8            for (Invocable.Action.AdditionalAttribute attr : attrs) {
9                System.debug('Attribute: ' + attr.getName());
10                System.debug('Data Type: ' + attr.getDataType());
11
12                // Handle collection vs single value
13                if (attr.getIsCollection()) {
14                    if (attr.getDataType() == 'STRING') {
15                        List<String> stringValues = attr.getValueAsStringList();
16                        System.debug('String Values: ' + stringValues);
17                    }
18                } else {
19                    System.debug('Value: ' + attr.getValue());
20                }
21            }
22        }
23    }
24}
25

Action.AdditionalAttribute Methods

The following are methods for Action.AdditionalAttribute.

getApexClass()

Gets the Apex class name of an additional attribute for an invocable action parameter.

Signature

public String getApexClass()

Return Value

Type: String

Apex class name of the additional attribute for the invocable action parameter.

getDataType()

Gets the data type of an additional attribute for an invocable action parameter.

Signature

public String getDataType()

Return Value

Type: String

Data type of the additional attribute for the invocable action parameter. For example: STRING, INTEGER, BOOLEAN, DOUBLE, LONG, DATE.

getIsCollection()

Indicates whether an additional attribute for an invocable action parameter contains a collection of values.

Signature

public Boolean getIsCollection()

Return Value

Type: Boolean

This method returns true if the additional attribute for the invocable action parameter is a collection.

getName()

Gets the name of an additional attribute for an invocable action parameter.

Signature

public String getName()

Return Value

Type: String

Name of the additional attribute for the invocable action parameter.

getValue()

Gets the value for an additional attribute for an invocable action parameter.

Signature

public Object getValue()

Return Value

Type: Object

Value of the additional attribute for the invocable action parameter. Cast to the appropriate type based on the dataType and isCollection.

getValueAsBooleanList()

Returns a value as a list of Booleans when isCollection is true and dataType is BOOLEAN.

Signature

public List<Boolean> getValueAsBooleanList()

Return Value

Type: List<Boolean>

List of Boolean values, or null if not a Boolean collection.

getValueAsDateList()

Returns a value as a list of dates when isCollection is true and dataType is DATE.

Signature

public List<Date> getValueAsDateList()

Return Value

Type: List<Date>

List of date values, or null if not a date collection.

getValueAsDoubleList()

Returns a value as a list of doubles when isCollection is true and dataType is DOUBLE.

Signature

public List<Double> getValueAsDoubleList()

Return Value

Type: List<Double>

List of double values, or null if not a double collection.

getValueAsIntegerList()

Returns a value as a list of integers when isCollection is true and dataType is INTEGER.

Signature

public List<Integer> getValueAsIntegerList()

Return Value

Type: List<Integer>

List of integer values, or null if not an integer collection.

getValueAsList()

Returns a value as a list when isCollection is true. The list elements have the type specified by the dataType property.

Signature

public List<ANY> getValueAsList()

Return Value

Type: List<Object>

List of values type according to dataType, or null if not a collection.

getValueAsLongList()

Returns a value as a list of longs when isCollection is true and dataType is LONG.

Signature

public List<Long> getValueAsLongList()

Return Value

Type: List<Long>

List of long values, or null if not a long collection.

getValueAsStringList()

Returns a value as a list of strings when isCollection is true and dataType is STRING.

Signature

public List<String> getValueAsStringList()

Return Value

Type: List<String>

List of string values, or null if not a string collection.