DTO_NameValue
Class · Group: Data Transfer Objects
apex
global inherited sharing class DTO_NameValueDTO class for name-value pairs, used in invocable methods for data mapping, such as merge fields or configuration settings. Designed for flexibility in flows, Aura components, or Apex logic, supporting scenarios like email template merge fields, parameter passing, or custom metadata updates.
Example
apex
DTO_NameValue pair = new DTO_NameValue();
pair.name = 'MergeField';
pair.value = 'Hello World';Constructors
| Constructor | Description |
|---|---|
| global DTO_NameValue() | Default no-argument constructor for flow and invocable compatibility. |
| global DTO_NameValue(String name, String value) | Constructs a new name-value pair with the specified key and value. |
DTO_NameValue()
apex
global DTO_NameValue()Default no-argument constructor for flow and invocable compatibility.
Example
apex
DTO_NameValue pair = new DTO_NameValue();
pair.name = 'MergeField';
pair.value = 'Hello World';DTO_NameValue(String name, String value)
apex
global DTO_NameValue(String name, String value)Constructs a new name-value pair with the specified key and value.
Parameters
| Parameter | Type | Description |
|---|---|---|
name | String | The name of the data field or placeholder. |
value | String | The value associated with the field name. |
Example
apex
DTO_NameValue pair = new DTO_NameValue('MergeField', 'Hello World');Fields
| Field | Description |
|---|---|
| global String name | The name of the data field or placeholder, used as a key in invocable methods. |
| global String value | The value associated with the field name, used for substitution or configuration. |
name
apex
@AuraEnabled @InvocableVariable(required=true description='The name of the data field or placeholder, used as a key in invocable methods (e.g., merge field placeholder or parameter key).' label='Field Name') global String nameType: String
The name of the data field or placeholder, used as a key in invocable methods.
value
apex
@AuraEnabled @InvocableVariable(required=false description='The value to associate with the field name, used for substitution or configuration in invocable methods (e.g., email body merge fields or parameter values).' label='Field Value') global String valueType: String
The value associated with the field name, used for substitution or configuration.