Skip to content

DTO_NameValue

Class · Group: Data Transfer Objects

apex
global inherited sharing class DTO_NameValue

DTO 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

ConstructorDescription
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

ParameterTypeDescription
nameStringThe name of the data field or placeholder.
valueStringThe value associated with the field name.

Example

apex
DTO_NameValue pair = new DTO_NameValue('MergeField', 'Hello World');

Fields

FieldDescription
global String nameThe name of the data field or placeholder, used as a key in invocable methods.
global String valueThe 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 name

Type: 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 value

Type: String

The value associated with the field name, used for substitution or configuration.