Action.AdditionalAttribute Class
Namespace
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}
25Action.AdditionalAttribute Methods
The following are methods for Action.AdditionalAttribute.
getApexClass()
Signature
public String getApexClass()
Return Value
Type: String
Apex class name of the additional attribute for the invocable action parameter.
getDataType()
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()
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()
Signature
public String getName()
getValue()
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.
getValueAsList()
Signature
public List<ANY> getValueAsList()
Return Value
Type: List<Object>
List of values type according to dataType, or null if not a collection.