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.

Since: 1.0

Example:

apex
DTO_NameValue pair = new DTO_NameValue();
pair.name = 'MergeField';
pair.value = '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.

Methods

MethodDescription
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.

Method Details

DTO_NameValue

apex
global DTO_NameValue()

Default no-argument constructor for flow and invocable compatibility.

Since: 1.0

Example:

apex
DTO_NameValue pair = new DTO_NameValue();
pair.name = 'MergeField';
pair.value = 'Hello World';

DTO_NameValue

apex
global DTO_NameValue(String name, String value)

Constructs a new name-value pair with the specified key and value.

Parameters:

  • name (String) - The name of the data field or placeholder.
  • value (String) - The value associated with the field name.

Since: 1.0

Example:

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

Field Details

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.

Since: 1.0

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.

Since: 1.0