sfmc-language-lsp 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/codeActions/ampscript.d.ts +4 -0
- package/dist/cjs/codeActions/ampscript.d.ts.map +1 -0
- package/dist/cjs/codeActions/ampscript.js +110 -0
- package/dist/cjs/codeActions/ampscript.js.map +1 -0
- package/dist/cjs/completions/ampscript.d.ts +9 -0
- package/dist/cjs/completions/ampscript.d.ts.map +1 -0
- package/dist/cjs/completions/ampscript.js +112 -0
- package/dist/cjs/completions/ampscript.js.map +1 -0
- package/dist/cjs/completions/ssjs.d.ts +7 -0
- package/dist/cjs/completions/ssjs.d.ts.map +1 -0
- package/dist/cjs/completions/ssjs.js +103 -0
- package/dist/cjs/completions/ssjs.js.map +1 -0
- package/dist/cjs/data/ampscript.d.ts +44 -0
- package/dist/cjs/data/ampscript.d.ts.map +1 -0
- package/dist/cjs/data/ampscript.js +2800 -0
- package/dist/cjs/data/ampscript.js.map +1 -0
- package/dist/cjs/data/ssjs.d.ts +55 -0
- package/dist/cjs/data/ssjs.d.ts.map +1 -0
- package/dist/cjs/data/ssjs.js +93 -0
- package/dist/cjs/data/ssjs.js.map +1 -0
- package/dist/cjs/definitions/ssjs.d.ts +13 -0
- package/dist/cjs/definitions/ssjs.d.ts.map +1 -0
- package/dist/cjs/definitions/ssjs.js +65 -0
- package/dist/cjs/definitions/ssjs.js.map +1 -0
- package/dist/cjs/hover/ampscript.d.ts +4 -0
- package/dist/cjs/hover/ampscript.d.ts.map +1 -0
- package/dist/cjs/hover/ampscript.js +46 -0
- package/dist/cjs/hover/ampscript.js.map +1 -0
- package/dist/cjs/hover/ssjs.d.ts +5 -0
- package/dist/cjs/hover/ssjs.d.ts.map +1 -0
- package/dist/cjs/hover/ssjs.js +161 -0
- package/dist/cjs/hover/ssjs.js.map +1 -0
- package/dist/cjs/index.d.ts +63 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js +154 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/signature/ampscript.d.ts +7 -0
- package/dist/cjs/signature/ampscript.d.ts.map +1 -0
- package/dist/cjs/signature/ampscript.js +24 -0
- package/dist/cjs/signature/ampscript.js.map +1 -0
- package/dist/cjs/signature/ssjs.d.ts +8 -0
- package/dist/cjs/signature/ssjs.d.ts.map +1 -0
- package/dist/cjs/signature/ssjs.js +75 -0
- package/dist/cjs/signature/ssjs.js.map +1 -0
- package/dist/cjs/types.d.ts +25 -0
- package/dist/cjs/types.d.ts.map +1 -0
- package/dist/cjs/types.js +21 -0
- package/dist/cjs/types.js.map +1 -0
- package/dist/cjs/utils/comments.d.ts +9 -0
- package/dist/cjs/utils/comments.d.ts.map +1 -0
- package/dist/cjs/utils/comments.js +72 -0
- package/dist/cjs/utils/comments.js.map +1 -0
- package/dist/cjs/utils/markdown.d.ts +30 -0
- package/dist/cjs/utils/markdown.d.ts.map +1 -0
- package/dist/cjs/utils/markdown.js +147 -0
- package/dist/cjs/utils/markdown.js.map +1 -0
- package/dist/cjs/utils/positions.d.ts +8 -0
- package/dist/cjs/utils/positions.d.ts.map +1 -0
- package/dist/cjs/utils/positions.js +31 -0
- package/dist/cjs/utils/positions.js.map +1 -0
- package/dist/cjs/utils/regions.d.ts +22 -0
- package/dist/cjs/utils/regions.d.ts.map +1 -0
- package/dist/cjs/utils/regions.js +126 -0
- package/dist/cjs/utils/regions.js.map +1 -0
- package/dist/cjs/utils/text.d.ts +41 -0
- package/dist/cjs/utils/text.d.ts.map +1 -0
- package/dist/cjs/utils/text.js +145 -0
- package/dist/cjs/utils/text.js.map +1 -0
- package/dist/cjs/validators/ampscript.d.ts +11 -0
- package/dist/cjs/validators/ampscript.d.ts.map +1 -0
- package/dist/cjs/validators/ampscript.js +449 -0
- package/dist/cjs/validators/ampscript.js.map +1 -0
- package/dist/cjs/validators/gtl.d.ts +7 -0
- package/dist/cjs/validators/gtl.d.ts.map +1 -0
- package/dist/cjs/validators/gtl.js +80 -0
- package/dist/cjs/validators/gtl.js.map +1 -0
- package/dist/cjs/validators/ssjs.d.ts +5 -0
- package/dist/cjs/validators/ssjs.d.ts.map +1 -0
- package/dist/cjs/validators/ssjs.js +122 -0
- package/dist/cjs/validators/ssjs.js.map +1 -0
- package/dist/esm/codeActions/ampscript.d.ts +4 -0
- package/dist/esm/codeActions/ampscript.d.ts.map +1 -0
- package/dist/esm/codeActions/ampscript.js +107 -0
- package/dist/esm/codeActions/ampscript.js.map +1 -0
- package/dist/esm/completions/ampscript.d.ts +9 -0
- package/dist/esm/completions/ampscript.d.ts.map +1 -0
- package/dist/esm/completions/ampscript.js +107 -0
- package/dist/esm/completions/ampscript.js.map +1 -0
- package/dist/esm/completions/ssjs.d.ts +7 -0
- package/dist/esm/completions/ssjs.d.ts.map +1 -0
- package/dist/esm/completions/ssjs.js +99 -0
- package/dist/esm/completions/ssjs.js.map +1 -0
- package/dist/esm/data/ampscript.d.ts +44 -0
- package/dist/esm/data/ampscript.d.ts.map +1 -0
- package/dist/esm/data/ampscript.js +2791 -0
- package/dist/esm/data/ampscript.js.map +1 -0
- package/dist/esm/data/ssjs.d.ts +55 -0
- package/dist/esm/data/ssjs.d.ts.map +1 -0
- package/dist/esm/data/ssjs.js +90 -0
- package/dist/esm/data/ssjs.js.map +1 -0
- package/dist/esm/definitions/ssjs.d.ts +13 -0
- package/dist/esm/definitions/ssjs.d.ts.map +1 -0
- package/dist/esm/definitions/ssjs.js +61 -0
- package/dist/esm/definitions/ssjs.js.map +1 -0
- package/dist/esm/hover/ampscript.d.ts +4 -0
- package/dist/esm/hover/ampscript.d.ts.map +1 -0
- package/dist/esm/hover/ampscript.js +43 -0
- package/dist/esm/hover/ampscript.js.map +1 -0
- package/dist/esm/hover/ssjs.d.ts +5 -0
- package/dist/esm/hover/ssjs.d.ts.map +1 -0
- package/dist/esm/hover/ssjs.js +158 -0
- package/dist/esm/hover/ssjs.js.map +1 -0
- package/dist/esm/index.d.ts +63 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +145 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/signature/ampscript.d.ts +7 -0
- package/dist/esm/signature/ampscript.d.ts.map +1 -0
- package/dist/esm/signature/ampscript.js +21 -0
- package/dist/esm/signature/ampscript.js.map +1 -0
- package/dist/esm/signature/ssjs.d.ts +8 -0
- package/dist/esm/signature/ssjs.d.ts.map +1 -0
- package/dist/esm/signature/ssjs.js +72 -0
- package/dist/esm/signature/ssjs.js.map +1 -0
- package/dist/esm/types.d.ts +25 -0
- package/dist/esm/types.d.ts.map +1 -0
- package/dist/esm/types.js +13 -0
- package/dist/esm/types.js.map +1 -0
- package/dist/esm/utils/comments.d.ts +9 -0
- package/dist/esm/utils/comments.d.ts.map +1 -0
- package/dist/esm/utils/comments.js +68 -0
- package/dist/esm/utils/comments.js.map +1 -0
- package/dist/esm/utils/markdown.d.ts +30 -0
- package/dist/esm/utils/markdown.d.ts.map +1 -0
- package/dist/esm/utils/markdown.js +139 -0
- package/dist/esm/utils/markdown.js.map +1 -0
- package/dist/esm/utils/positions.d.ts +8 -0
- package/dist/esm/utils/positions.d.ts.map +1 -0
- package/dist/esm/utils/positions.js +26 -0
- package/dist/esm/utils/positions.js.map +1 -0
- package/dist/esm/utils/regions.d.ts +22 -0
- package/dist/esm/utils/regions.d.ts.map +1 -0
- package/dist/esm/utils/regions.js +121 -0
- package/dist/esm/utils/regions.js.map +1 -0
- package/dist/esm/utils/text.d.ts +41 -0
- package/dist/esm/utils/text.d.ts.map +1 -0
- package/dist/esm/utils/text.js +137 -0
- package/dist/esm/utils/text.js.map +1 -0
- package/dist/esm/validators/ampscript.d.ts +11 -0
- package/dist/esm/validators/ampscript.d.ts.map +1 -0
- package/dist/esm/validators/ampscript.js +445 -0
- package/dist/esm/validators/ampscript.js.map +1 -0
- package/dist/esm/validators/gtl.d.ts +7 -0
- package/dist/esm/validators/gtl.d.ts.map +1 -0
- package/dist/esm/validators/gtl.js +77 -0
- package/dist/esm/validators/gtl.js.map +1 -0
- package/dist/esm/validators/ssjs.d.ts +5 -0
- package/dist/esm/validators/ssjs.d.ts.map +1 -0
- package/dist/esm/validators/ssjs.js +119 -0
- package/dist/esm/validators/ssjs.js.map +1 -0
- package/dist/types/codeActions/ampscript.d.ts +4 -0
- package/dist/types/codeActions/ampscript.d.ts.map +1 -0
- package/dist/types/completions/ampscript.d.ts +9 -0
- package/dist/types/completions/ampscript.d.ts.map +1 -0
- package/dist/types/completions/ssjs.d.ts +7 -0
- package/dist/types/completions/ssjs.d.ts.map +1 -0
- package/dist/types/data/ampscript.d.ts +44 -0
- package/dist/types/data/ampscript.d.ts.map +1 -0
- package/dist/types/data/ssjs.d.ts +55 -0
- package/dist/types/data/ssjs.d.ts.map +1 -0
- package/dist/types/definitions/ssjs.d.ts +13 -0
- package/dist/types/definitions/ssjs.d.ts.map +1 -0
- package/dist/types/hover/ampscript.d.ts +4 -0
- package/dist/types/hover/ampscript.d.ts.map +1 -0
- package/dist/types/hover/ssjs.d.ts +5 -0
- package/dist/types/hover/ssjs.d.ts.map +1 -0
- package/dist/types/index.d.ts +63 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/signature/ampscript.d.ts +7 -0
- package/dist/types/signature/ampscript.d.ts.map +1 -0
- package/dist/types/signature/ssjs.d.ts +8 -0
- package/dist/types/signature/ssjs.d.ts.map +1 -0
- package/dist/types/types.d.ts +25 -0
- package/dist/types/types.d.ts.map +1 -0
- package/dist/types/utils/comments.d.ts +9 -0
- package/dist/types/utils/comments.d.ts.map +1 -0
- package/dist/types/utils/markdown.d.ts +30 -0
- package/dist/types/utils/markdown.d.ts.map +1 -0
- package/dist/types/utils/positions.d.ts +8 -0
- package/dist/types/utils/positions.d.ts.map +1 -0
- package/dist/types/utils/regions.d.ts +22 -0
- package/dist/types/utils/regions.d.ts.map +1 -0
- package/dist/types/utils/text.d.ts +41 -0
- package/dist/types/utils/text.d.ts.map +1 -0
- package/dist/types/validators/ampscript.d.ts +11 -0
- package/dist/types/validators/ampscript.d.ts.map +1 -0
- package/dist/types/validators/gtl.d.ts +7 -0
- package/dist/types/validators/gtl.d.ts.map +1 -0
- package/dist/types/validators/ssjs.d.ts +5 -0
- package/dist/types/validators/ssjs.d.ts.map +1 -0
- package/package.json +58 -0
|
@@ -0,0 +1,2791 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AMPscript function definitions for auto-completion and hover/intellisense.
|
|
3
|
+
*
|
|
4
|
+
* Canonical function names, keywords, and personalization strings are sourced
|
|
5
|
+
* from the shared ampscript-data package. Rich descriptions, parameter docs,
|
|
6
|
+
* and examples in this file are original content for this extension.
|
|
7
|
+
*/
|
|
8
|
+
// Re-export shared canonical data for use throughout the language server
|
|
9
|
+
export { FUNCTIONS as canonicalFunctions, FUNCTION_CANONICAL_MAP, AMPSCRIPT_KEYWORDS as canonicalKeywordNames, PERSONALIZATION_STRINGS as canonicalPersonalizationStrings, functionNames, isEmailExcluded, } from 'ampscript-data';
|
|
10
|
+
export const ampscriptFunctions = [
|
|
11
|
+
{
|
|
12
|
+
name: 'Add',
|
|
13
|
+
syntax: 'Add(number1, number2)',
|
|
14
|
+
description: 'Computes the sum of two numeric values and returns the result.',
|
|
15
|
+
category: 'Math',
|
|
16
|
+
params: [
|
|
17
|
+
{ name: 'number1', description: 'First numeric operand', type: 'number' },
|
|
18
|
+
{ name: 'number2', description: 'Second numeric operand', type: 'number' },
|
|
19
|
+
],
|
|
20
|
+
returnType: 'number',
|
|
21
|
+
example: '%%=Add(15, 27)=%%\n/* result: 42 */',
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: 'AddMSCRMListMember',
|
|
25
|
+
syntax: 'AddMSCRMListMember(listID, entityID)',
|
|
26
|
+
description: 'Appends a member to a Microsoft Dynamics CRM list. Does not produce output.',
|
|
27
|
+
category: 'Microsoft Dynamics CRM',
|
|
28
|
+
params: [
|
|
29
|
+
{ name: 'listID', description: 'Identifier of the target CRM list', type: 'string' },
|
|
30
|
+
{ name: 'entityID', description: 'Identifier of the entity to add', type: 'string' },
|
|
31
|
+
],
|
|
32
|
+
returnType: 'void',
|
|
33
|
+
example: '%%[\n AddMSCRMListMember(@listRef, @recordId)\n]%%',
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: 'AddObjectArrayItem',
|
|
37
|
+
syntax: 'AddObjectArrayItem(apiObject, propertyName, value)',
|
|
38
|
+
description: 'Appends an item to an array property on a Marketing Cloud API object.',
|
|
39
|
+
category: 'Marketing Cloud API',
|
|
40
|
+
params: [
|
|
41
|
+
{ name: 'apiObject', description: 'API object reference', type: 'object' },
|
|
42
|
+
{ name: 'propertyName', description: 'Name of the array property', type: 'string' },
|
|
43
|
+
{ name: 'value', description: 'Value to append', type: 'string' },
|
|
44
|
+
],
|
|
45
|
+
returnType: 'void',
|
|
46
|
+
example: '%%[\n set @obj = CreateObject("DataExtensionObject")\n AddObjectArrayItem(@obj, "Items", @item)\n]%%',
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: 'AttachFile',
|
|
50
|
+
syntax: 'AttachFile(portfolio, customerKey, fileName, mimeType, isInline, contentDisposition, encoding, contentId)',
|
|
51
|
+
description: 'Includes a file attachment in the outgoing message, or renders a download link on a landing page.',
|
|
52
|
+
category: 'Content',
|
|
53
|
+
params: [
|
|
54
|
+
{
|
|
55
|
+
name: 'portfolio',
|
|
56
|
+
description: 'Portfolio or content builder asset source',
|
|
57
|
+
type: 'string',
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: 'customerKey',
|
|
61
|
+
description: 'Customer/external key of the file',
|
|
62
|
+
type: 'string',
|
|
63
|
+
},
|
|
64
|
+
{ name: 'fileName', description: 'Display name for the attachment', type: 'string' },
|
|
65
|
+
{
|
|
66
|
+
name: 'mimeType',
|
|
67
|
+
description: 'MIME type string, e.g. "application/pdf"',
|
|
68
|
+
type: 'string',
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
name: 'isInline',
|
|
72
|
+
description: 'Whether file is shown inline',
|
|
73
|
+
type: 'boolean',
|
|
74
|
+
optional: true,
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
name: 'contentDisposition',
|
|
78
|
+
description: 'Content-Disposition header value',
|
|
79
|
+
type: 'string',
|
|
80
|
+
optional: true,
|
|
81
|
+
},
|
|
82
|
+
{ name: 'encoding', description: 'Character encoding', type: 'string', optional: true },
|
|
83
|
+
{
|
|
84
|
+
name: 'contentId',
|
|
85
|
+
description: 'Content-ID for inline references',
|
|
86
|
+
type: 'string',
|
|
87
|
+
optional: true,
|
|
88
|
+
},
|
|
89
|
+
],
|
|
90
|
+
returnType: 'void',
|
|
91
|
+
example: '%%[\n AttachFile("Portfolio", "report-key", "Report.pdf", "application/pdf")\n]%%',
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
name: 'AttributeValue',
|
|
95
|
+
syntax: 'AttributeValue(attributeName)',
|
|
96
|
+
description: 'Safely retrieves an attribute value from the current subscriber/contact context. Returns null instead of raising an error when the attribute is absent.',
|
|
97
|
+
category: 'Utility',
|
|
98
|
+
params: [
|
|
99
|
+
{
|
|
100
|
+
name: 'attributeName',
|
|
101
|
+
description: 'Name of the subscriber or data extension attribute',
|
|
102
|
+
type: 'string',
|
|
103
|
+
},
|
|
104
|
+
],
|
|
105
|
+
returnType: 'string',
|
|
106
|
+
example: '%%[\n set @email = AttributeValue("EmailAddress")\n]%%',
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
name: 'AuthenticatedEmployeeID',
|
|
110
|
+
syntax: 'AuthenticatedEmployeeID()',
|
|
111
|
+
description: 'Retrieves the numeric ID of the Marketing Cloud user currently logged into the page.',
|
|
112
|
+
category: 'Utility',
|
|
113
|
+
params: [],
|
|
114
|
+
returnType: 'number',
|
|
115
|
+
example: '%%=AuthenticatedEmployeeID()=%%',
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
name: 'AuthenticatedEmployeeNotificationAddress',
|
|
119
|
+
syntax: 'AuthenticatedEmployeeNotificationAddress()',
|
|
120
|
+
description: 'Retrieves the notification email address associated with the authenticated Marketing Cloud user.',
|
|
121
|
+
category: 'Utility',
|
|
122
|
+
params: [],
|
|
123
|
+
returnType: 'string',
|
|
124
|
+
example: '%%=AuthenticatedEmployeeNotificationAddress()=%%',
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
name: 'AuthenticatedEmployeeUserName',
|
|
128
|
+
syntax: 'AuthenticatedEmployeeUserName()',
|
|
129
|
+
description: 'Retrieves the username of the Marketing Cloud user who is currently authenticated.',
|
|
130
|
+
category: 'Utility',
|
|
131
|
+
params: [],
|
|
132
|
+
returnType: 'string',
|
|
133
|
+
example: '%%=AuthenticatedEmployeeUserName()=%%',
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
name: 'AuthenticatedEnterpriseID',
|
|
137
|
+
syntax: 'AuthenticatedEnterpriseID()',
|
|
138
|
+
description: 'Returns the Enterprise ID (parent MID) for the current Marketing Cloud session.',
|
|
139
|
+
category: 'Utility',
|
|
140
|
+
params: [],
|
|
141
|
+
returnType: 'number',
|
|
142
|
+
example: '%%=AuthenticatedEnterpriseID()=%%',
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
name: 'AuthenticatedMemberID',
|
|
146
|
+
syntax: 'AuthenticatedMemberID()',
|
|
147
|
+
description: 'Returns the MID (Member ID) of the business unit for the authenticated session.',
|
|
148
|
+
category: 'Utility',
|
|
149
|
+
params: [],
|
|
150
|
+
returnType: 'number',
|
|
151
|
+
example: '%%=AuthenticatedMemberID()=%%',
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
name: 'AuthenticatedMemberName',
|
|
155
|
+
syntax: 'AuthenticatedMemberName()',
|
|
156
|
+
description: 'Returns the account name for the business unit of the current authenticated session.',
|
|
157
|
+
category: 'Utility',
|
|
158
|
+
params: [],
|
|
159
|
+
returnType: 'string',
|
|
160
|
+
example: '%%=AuthenticatedMemberName()=%%',
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
name: 'BarcodeURL',
|
|
164
|
+
syntax: 'BarcodeURL(type, value, width, height, quality, rotation, includeText, textPosition, textAlignment)',
|
|
165
|
+
description: 'Produces a URL pointing to a dynamically generated barcode image.',
|
|
166
|
+
category: 'Content',
|
|
167
|
+
params: [
|
|
168
|
+
{ name: 'type', description: 'Barcode type (e.g. "UPCA", "Code128")', type: 'string' },
|
|
169
|
+
{ name: 'value', description: 'Data to encode in the barcode', type: 'string' },
|
|
170
|
+
{ name: 'width', description: 'Image width in pixels', type: 'number' },
|
|
171
|
+
{ name: 'height', description: 'Image height in pixels', type: 'number' },
|
|
172
|
+
{ name: 'quality', description: 'Image quality setting', type: 'string' },
|
|
173
|
+
{ name: 'rotation', description: 'Rotation angle', type: 'number' },
|
|
174
|
+
{
|
|
175
|
+
name: 'includeText',
|
|
176
|
+
description: 'Whether to show text below barcode',
|
|
177
|
+
type: 'boolean',
|
|
178
|
+
},
|
|
179
|
+
{ name: 'textPosition', description: 'Position of text label', type: 'string' },
|
|
180
|
+
{ name: 'textAlignment', description: 'Alignment of text label', type: 'string' },
|
|
181
|
+
],
|
|
182
|
+
returnType: 'string',
|
|
183
|
+
example: '%%=BarcodeURL("Code128", @coupon, 300, 100, "H", 0, true, "Bottom", "Center")=%%',
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
name: 'Base64Decode',
|
|
187
|
+
syntax: 'Base64Decode(encodedString, encoding, convertFromHex)',
|
|
188
|
+
description: 'Decodes a Base64-encoded string back to its original form.',
|
|
189
|
+
category: 'Encryption and Encoding',
|
|
190
|
+
params: [
|
|
191
|
+
{ name: 'encodedString', description: 'The Base64-encoded input', type: 'string' },
|
|
192
|
+
{
|
|
193
|
+
name: 'encoding',
|
|
194
|
+
description: 'Character encoding (e.g. "UTF-8")',
|
|
195
|
+
type: 'string',
|
|
196
|
+
optional: true,
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
name: 'convertFromHex',
|
|
200
|
+
description: 'Whether to convert from hex after decoding',
|
|
201
|
+
type: 'boolean',
|
|
202
|
+
optional: true,
|
|
203
|
+
},
|
|
204
|
+
],
|
|
205
|
+
returnType: 'string',
|
|
206
|
+
example: '%%[\n set @decoded = Base64Decode(@payload)\n]%%',
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
name: 'Base64Encode',
|
|
210
|
+
syntax: 'Base64Encode(inputString, encoding)',
|
|
211
|
+
description: 'Encodes a string to its Base64 representation.',
|
|
212
|
+
category: 'Encryption and Encoding',
|
|
213
|
+
params: [
|
|
214
|
+
{ name: 'inputString', description: 'The string to encode', type: 'string' },
|
|
215
|
+
{
|
|
216
|
+
name: 'encoding',
|
|
217
|
+
description: 'Character encoding (e.g. "UTF-8")',
|
|
218
|
+
type: 'string',
|
|
219
|
+
optional: true,
|
|
220
|
+
},
|
|
221
|
+
],
|
|
222
|
+
returnType: 'string',
|
|
223
|
+
example: '%%[\n set @token = Base64Encode("admin:s3cret")\n]%%',
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
name: 'BeginImpressionRegion',
|
|
227
|
+
syntax: 'BeginImpressionRegion(regionName)',
|
|
228
|
+
description: 'Opens a named content impression region for tracking purposes. Pair with EndImpressionRegion.',
|
|
229
|
+
category: 'Content',
|
|
230
|
+
params: [
|
|
231
|
+
{
|
|
232
|
+
name: 'regionName',
|
|
233
|
+
description: 'Unique name for the impression region',
|
|
234
|
+
type: 'string',
|
|
235
|
+
},
|
|
236
|
+
],
|
|
237
|
+
returnType: 'void',
|
|
238
|
+
example: '%%=BeginImpressionRegion("hero_banner")=%%',
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
name: 'BuildOptionList',
|
|
242
|
+
syntax: 'BuildOptionList(dataExtension, displayColumn, valueColumn, selectedValue...)',
|
|
243
|
+
description: 'Generates HTML <option> elements suitable for use within <select>, <optgroup>, or <datalist> tags.',
|
|
244
|
+
category: 'Content',
|
|
245
|
+
params: [
|
|
246
|
+
{
|
|
247
|
+
name: 'dataExtension',
|
|
248
|
+
description: 'Name of the Data Extension to read options from',
|
|
249
|
+
type: 'string',
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
name: 'displayColumn',
|
|
253
|
+
description: 'Column name for the visible option text',
|
|
254
|
+
type: 'string',
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
name: 'valueColumn',
|
|
258
|
+
description: 'Column name for the option value attribute',
|
|
259
|
+
type: 'string',
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
name: 'selectedValue',
|
|
263
|
+
description: 'Value to mark as pre-selected',
|
|
264
|
+
type: 'string',
|
|
265
|
+
optional: true,
|
|
266
|
+
},
|
|
267
|
+
],
|
|
268
|
+
returnType: 'string',
|
|
269
|
+
example: '%%=BuildOptionList("Regions", "Label", "Value", @chosenRegion)=%%',
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
name: 'BuildRowsetFromJSON',
|
|
273
|
+
syntax: 'BuildRowsetFromJSON(jsonString, jsonPath, columnName)',
|
|
274
|
+
description: 'Parses a JSON string and constructs a row set from the values found at the specified JSON path.',
|
|
275
|
+
category: 'Content',
|
|
276
|
+
params: [
|
|
277
|
+
{ name: 'jsonString', description: 'JSON data to parse', type: 'string' },
|
|
278
|
+
{
|
|
279
|
+
name: 'jsonPath',
|
|
280
|
+
description: 'JSON path expression to select nodes',
|
|
281
|
+
type: 'string',
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
name: 'columnName',
|
|
285
|
+
description: 'Name for the resulting column',
|
|
286
|
+
type: 'string',
|
|
287
|
+
optional: true,
|
|
288
|
+
},
|
|
289
|
+
],
|
|
290
|
+
returnType: 'rowset',
|
|
291
|
+
example: '%%[\n set @rows = BuildRowsetFromJSON(@apiResponse, "$.results[*].sku")\n]%%',
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
name: 'BuildRowSetFromString',
|
|
295
|
+
syntax: 'BuildRowSetFromString(inputString, delimiter)',
|
|
296
|
+
description: 'Splits a delimited string into a row set where each segment becomes a row.',
|
|
297
|
+
category: 'Content',
|
|
298
|
+
params: [
|
|
299
|
+
{ name: 'inputString', description: 'The string to split', type: 'string' },
|
|
300
|
+
{ name: 'delimiter', description: 'Delimiter to split on', type: 'string' },
|
|
301
|
+
],
|
|
302
|
+
returnType: 'rowset',
|
|
303
|
+
example: '%%[\n set @colors = BuildRowSetFromString("red,blue,green", ",")\n]%%',
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
name: 'BuildRowSetFromXML',
|
|
307
|
+
syntax: 'BuildRowSetFromXML(xmlString, xpath, isSensitive)',
|
|
308
|
+
description: 'Extracts data from an XML string via an XPath expression and returns it as a row set.',
|
|
309
|
+
category: 'Content',
|
|
310
|
+
params: [
|
|
311
|
+
{ name: 'xmlString', description: 'Input XML data', type: 'string' },
|
|
312
|
+
{ name: 'xpath', description: 'XPath expression to select nodes', type: 'string' },
|
|
313
|
+
{
|
|
314
|
+
name: 'isSensitive',
|
|
315
|
+
description: 'Whether selection is case-sensitive',
|
|
316
|
+
type: 'boolean',
|
|
317
|
+
optional: true,
|
|
318
|
+
},
|
|
319
|
+
],
|
|
320
|
+
returnType: 'rowset',
|
|
321
|
+
example: '%%[\n set @nodes = BuildRowSetFromXML(@xmlPayload, "/catalog/product")\n]%%',
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
name: 'Char',
|
|
325
|
+
syntax: 'Char(asciiCode)',
|
|
326
|
+
description: 'Converts an ASCII code number to its corresponding character.',
|
|
327
|
+
category: 'String',
|
|
328
|
+
params: [
|
|
329
|
+
{ name: 'asciiCode', description: 'The ASCII character code (0-127)', type: 'number' },
|
|
330
|
+
],
|
|
331
|
+
returnType: 'string',
|
|
332
|
+
example: '%%[\n /* newline character */\n set @nl = Char(10)\n]%%',
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
name: 'ClaimRow',
|
|
336
|
+
syntax: 'ClaimRow(dataExtension, lockColumn, lockValue, keyColumn, keyValue...)',
|
|
337
|
+
description: 'Reserves and returns a single unclaimed row from a Data Extension, preventing concurrent use. Commonly used for unique coupon distribution.',
|
|
338
|
+
category: 'Data Extension',
|
|
339
|
+
params: [
|
|
340
|
+
{ name: 'dataExtension', description: 'Name of the Data Extension', type: 'string' },
|
|
341
|
+
{ name: 'lockColumn', description: 'Column used for the lock flag', type: 'string' },
|
|
342
|
+
{ name: 'lockValue', description: 'Value written to lock the row', type: 'string' },
|
|
343
|
+
{ name: 'keyColumn', description: 'Column name for filtering', type: 'string' },
|
|
344
|
+
{
|
|
345
|
+
name: 'keyValue',
|
|
346
|
+
description: 'Value to match in the key column',
|
|
347
|
+
type: 'string',
|
|
348
|
+
optional: true,
|
|
349
|
+
},
|
|
350
|
+
],
|
|
351
|
+
returnType: 'row',
|
|
352
|
+
example: '%%[\n set @voucherRow = ClaimRow("OfferPool", "Assigned", "true", "Segment", "premium")\n]%%',
|
|
353
|
+
},
|
|
354
|
+
{
|
|
355
|
+
name: 'ClaimRowValue',
|
|
356
|
+
syntax: 'ClaimRowValue(returnColumn, dataExtension, lockColumn, lockValue, defaultValue, keyColumn, keyValue...)',
|
|
357
|
+
description: "Like ClaimRow but returns a specific column's value. If no unclaimed rows remain, returns the specified default instead of erroring.",
|
|
358
|
+
category: 'Data Extension',
|
|
359
|
+
params: [
|
|
360
|
+
{ name: 'returnColumn', description: 'Column whose value to return', type: 'string' },
|
|
361
|
+
{ name: 'dataExtension', description: 'Name of the Data Extension', type: 'string' },
|
|
362
|
+
{ name: 'lockColumn', description: 'Column used for the lock flag', type: 'string' },
|
|
363
|
+
{ name: 'lockValue', description: 'Value written to lock the row', type: 'string' },
|
|
364
|
+
{
|
|
365
|
+
name: 'defaultValue',
|
|
366
|
+
description: 'Fallback value if no rows available',
|
|
367
|
+
type: 'string',
|
|
368
|
+
},
|
|
369
|
+
{ name: 'keyColumn', description: 'Column name for filtering', type: 'string' },
|
|
370
|
+
{
|
|
371
|
+
name: 'keyValue',
|
|
372
|
+
description: 'Value to match in the key column',
|
|
373
|
+
type: 'string',
|
|
374
|
+
optional: true,
|
|
375
|
+
},
|
|
376
|
+
],
|
|
377
|
+
returnType: 'string',
|
|
378
|
+
example: '%%[\n set @code = ClaimRowValue("Token", "OfferPool", "Redeemed", "1", "DEFAULT99", "Level", @level)\n]%%',
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
name: 'CloudPagesURL',
|
|
382
|
+
syntax: 'CloudPagesURL(pageID, param1Name, param1Value...)',
|
|
383
|
+
description: 'Builds an encrypted URL to a CloudPages landing page, optionally appending name/value parameter pairs to the query string.',
|
|
384
|
+
category: 'Utility',
|
|
385
|
+
params: [
|
|
386
|
+
{ name: 'pageID', description: 'ID of the CloudPages page (number or string)' },
|
|
387
|
+
{
|
|
388
|
+
name: 'param1Name',
|
|
389
|
+
description: 'Name of first query parameter',
|
|
390
|
+
type: 'string',
|
|
391
|
+
optional: true,
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
name: 'param1Value',
|
|
395
|
+
description: 'Value of first query parameter',
|
|
396
|
+
type: 'string',
|
|
397
|
+
optional: true,
|
|
398
|
+
},
|
|
399
|
+
],
|
|
400
|
+
returnType: 'string',
|
|
401
|
+
example: '%%[\n set @url = CloudPagesURL(842, "sku", @productSku, "uid", @recipientId)\n]%%',
|
|
402
|
+
},
|
|
403
|
+
{
|
|
404
|
+
name: 'Concat',
|
|
405
|
+
syntax: 'Concat(string1, string2, ...stringN)',
|
|
406
|
+
description: 'Joins two or more string values together end-to-end.',
|
|
407
|
+
category: 'String',
|
|
408
|
+
params: [
|
|
409
|
+
{ name: 'string1', description: 'First string', type: 'string' },
|
|
410
|
+
{ name: 'string2', description: 'Second string', type: 'string' },
|
|
411
|
+
{
|
|
412
|
+
name: 'stringN',
|
|
413
|
+
description: 'Additional strings to append',
|
|
414
|
+
type: 'string',
|
|
415
|
+
optional: true,
|
|
416
|
+
},
|
|
417
|
+
],
|
|
418
|
+
returnType: 'string',
|
|
419
|
+
example: '%%[\n set @greeting = Concat("Hello, ", @userName, "!")\n]%%',
|
|
420
|
+
},
|
|
421
|
+
{
|
|
422
|
+
name: 'ContentArea',
|
|
423
|
+
syntax: 'ContentArea(contentAreaID, impressionRegion, layout, throwError, defaultContent)',
|
|
424
|
+
description: 'Retrieves content from a Classic Content Area by its numeric ID.',
|
|
425
|
+
category: 'Content',
|
|
426
|
+
params: [
|
|
427
|
+
{
|
|
428
|
+
name: 'contentAreaID',
|
|
429
|
+
description: 'Numeric ID of the Content Area',
|
|
430
|
+
type: 'number',
|
|
431
|
+
},
|
|
432
|
+
{
|
|
433
|
+
name: 'impressionRegion',
|
|
434
|
+
description: 'Impression region name',
|
|
435
|
+
type: 'string',
|
|
436
|
+
optional: true,
|
|
437
|
+
},
|
|
438
|
+
{
|
|
439
|
+
name: 'layout',
|
|
440
|
+
description: 'Layout type (e.g. "block")',
|
|
441
|
+
type: 'boolean',
|
|
442
|
+
optional: true,
|
|
443
|
+
},
|
|
444
|
+
{
|
|
445
|
+
name: 'throwError',
|
|
446
|
+
description: 'Whether to throw on missing content',
|
|
447
|
+
type: 'string',
|
|
448
|
+
optional: true,
|
|
449
|
+
},
|
|
450
|
+
{
|
|
451
|
+
name: 'defaultContent',
|
|
452
|
+
description: 'Fallback content string',
|
|
453
|
+
type: 'boolean',
|
|
454
|
+
optional: true,
|
|
455
|
+
},
|
|
456
|
+
],
|
|
457
|
+
returnType: 'string',
|
|
458
|
+
example: '%%=ContentArea(1234)=%%',
|
|
459
|
+
},
|
|
460
|
+
{
|
|
461
|
+
name: 'ContentAreaByName',
|
|
462
|
+
syntax: 'ContentAreaByName(folderPath, impressionRegion, layout, throwError, defaultContent)',
|
|
463
|
+
description: 'Retrieves content from a Classic Content Area by its full folder path.',
|
|
464
|
+
category: 'Content',
|
|
465
|
+
params: [
|
|
466
|
+
{
|
|
467
|
+
name: 'folderPath',
|
|
468
|
+
description: String.raw `Full path to the Content Area, e.g. "my content\header"`,
|
|
469
|
+
type: 'string',
|
|
470
|
+
},
|
|
471
|
+
{
|
|
472
|
+
name: 'impressionRegion',
|
|
473
|
+
description: 'Impression region name',
|
|
474
|
+
type: 'string',
|
|
475
|
+
optional: true,
|
|
476
|
+
},
|
|
477
|
+
{ name: 'layout', description: 'Layout type', type: 'boolean', optional: true },
|
|
478
|
+
{
|
|
479
|
+
name: 'throwError',
|
|
480
|
+
description: 'Whether to throw on missing content',
|
|
481
|
+
type: 'string',
|
|
482
|
+
optional: true,
|
|
483
|
+
},
|
|
484
|
+
{
|
|
485
|
+
name: 'defaultContent',
|
|
486
|
+
description: 'Fallback content string',
|
|
487
|
+
type: 'boolean',
|
|
488
|
+
optional: true,
|
|
489
|
+
},
|
|
490
|
+
],
|
|
491
|
+
returnType: 'string',
|
|
492
|
+
example: String.raw `%%=ContentAreaByName("my content\header")=%%`,
|
|
493
|
+
},
|
|
494
|
+
{
|
|
495
|
+
name: 'ContentBlockByID',
|
|
496
|
+
syntax: 'ContentBlockByID(contentBlockID, impressionRegion, throwError, defaultContent, treatAsContent)',
|
|
497
|
+
description: 'Fetches a Content Builder block by its numeric ID and renders its content.',
|
|
498
|
+
category: 'Content',
|
|
499
|
+
params: [
|
|
500
|
+
{
|
|
501
|
+
name: 'contentBlockID',
|
|
502
|
+
description: 'ID of the content block (number or string)',
|
|
503
|
+
},
|
|
504
|
+
{
|
|
505
|
+
name: 'impressionRegion',
|
|
506
|
+
description: 'Impression region name',
|
|
507
|
+
type: 'string',
|
|
508
|
+
optional: true,
|
|
509
|
+
},
|
|
510
|
+
{
|
|
511
|
+
name: 'throwError',
|
|
512
|
+
description: 'Whether to throw if the block is not found',
|
|
513
|
+
type: 'boolean',
|
|
514
|
+
optional: true,
|
|
515
|
+
},
|
|
516
|
+
{
|
|
517
|
+
name: 'defaultContent',
|
|
518
|
+
description: 'Fallback content',
|
|
519
|
+
type: 'string',
|
|
520
|
+
optional: true,
|
|
521
|
+
},
|
|
522
|
+
{
|
|
523
|
+
name: 'treatAsContent',
|
|
524
|
+
description: 'Whether to evaluate AMPscript within',
|
|
525
|
+
type: 'boolean',
|
|
526
|
+
optional: true,
|
|
527
|
+
},
|
|
528
|
+
],
|
|
529
|
+
returnType: 'string',
|
|
530
|
+
example: '%%=ContentBlockByID(5678)=%%',
|
|
531
|
+
},
|
|
532
|
+
{
|
|
533
|
+
name: 'ContentBlockByKey',
|
|
534
|
+
syntax: 'ContentBlockByKey(customerKey, impressionRegion, throwError, defaultContent, treatAsContent)',
|
|
535
|
+
description: 'Fetches a Content Builder block by its customer/external key and renders its content.',
|
|
536
|
+
category: 'Content',
|
|
537
|
+
params: [
|
|
538
|
+
{
|
|
539
|
+
name: 'customerKey',
|
|
540
|
+
description: 'The customer key of the content block',
|
|
541
|
+
type: 'string',
|
|
542
|
+
},
|
|
543
|
+
{
|
|
544
|
+
name: 'impressionRegion',
|
|
545
|
+
description: 'Impression region name',
|
|
546
|
+
type: 'string',
|
|
547
|
+
optional: true,
|
|
548
|
+
},
|
|
549
|
+
{
|
|
550
|
+
name: 'throwError',
|
|
551
|
+
description: 'Whether to throw if the block is not found',
|
|
552
|
+
type: 'boolean',
|
|
553
|
+
optional: true,
|
|
554
|
+
},
|
|
555
|
+
{
|
|
556
|
+
name: 'defaultContent',
|
|
557
|
+
description: 'Fallback content',
|
|
558
|
+
type: 'string',
|
|
559
|
+
optional: true,
|
|
560
|
+
},
|
|
561
|
+
{
|
|
562
|
+
name: 'treatAsContent',
|
|
563
|
+
description: 'Whether to evaluate AMPscript within',
|
|
564
|
+
type: 'boolean',
|
|
565
|
+
optional: true,
|
|
566
|
+
},
|
|
567
|
+
],
|
|
568
|
+
returnType: 'string',
|
|
569
|
+
example: '%%=ContentBlockByKey("footer-2024")=%%',
|
|
570
|
+
},
|
|
571
|
+
{
|
|
572
|
+
name: 'ContentBlockByName',
|
|
573
|
+
syntax: 'ContentBlockByName(folderPath, impressionRegion, throwError, defaultContent, treatAsContent)',
|
|
574
|
+
description: 'Fetches a Content Builder block by its full path and renders its content.',
|
|
575
|
+
category: 'Content',
|
|
576
|
+
params: [
|
|
577
|
+
{
|
|
578
|
+
name: 'folderPath',
|
|
579
|
+
description: 'Full Content Builder path to the block',
|
|
580
|
+
type: 'string',
|
|
581
|
+
},
|
|
582
|
+
{
|
|
583
|
+
name: 'impressionRegion',
|
|
584
|
+
description: 'Impression region name',
|
|
585
|
+
type: 'string',
|
|
586
|
+
optional: true,
|
|
587
|
+
},
|
|
588
|
+
{
|
|
589
|
+
name: 'throwError',
|
|
590
|
+
description: 'Whether to throw if the block is not found',
|
|
591
|
+
type: 'boolean',
|
|
592
|
+
optional: true,
|
|
593
|
+
},
|
|
594
|
+
{
|
|
595
|
+
name: 'defaultContent',
|
|
596
|
+
description: 'Fallback content',
|
|
597
|
+
type: 'string',
|
|
598
|
+
optional: true,
|
|
599
|
+
},
|
|
600
|
+
{
|
|
601
|
+
name: 'treatAsContent',
|
|
602
|
+
description: 'Whether to evaluate AMPscript within',
|
|
603
|
+
type: 'boolean',
|
|
604
|
+
optional: true,
|
|
605
|
+
},
|
|
606
|
+
],
|
|
607
|
+
returnType: 'string',
|
|
608
|
+
example: String.raw `%%=ContentBlockByName("Content Builder\Shared\Footer")=%%`,
|
|
609
|
+
},
|
|
610
|
+
{
|
|
611
|
+
name: 'ContentImageByID',
|
|
612
|
+
syntax: 'ContentImageByID(imageID, altText)',
|
|
613
|
+
description: 'Generates an HTML <img> tag for a Content Builder image referenced by numeric ID.',
|
|
614
|
+
category: 'Content',
|
|
615
|
+
params: [
|
|
616
|
+
{ name: 'imageID', description: 'Numeric ID of the image asset', type: 'number' },
|
|
617
|
+
{
|
|
618
|
+
name: 'altText',
|
|
619
|
+
description: 'Alt-text for the image',
|
|
620
|
+
type: 'string',
|
|
621
|
+
optional: true,
|
|
622
|
+
},
|
|
623
|
+
],
|
|
624
|
+
returnType: 'string',
|
|
625
|
+
example: '%%=ContentImageByID(9012, "Product photo")=%%',
|
|
626
|
+
},
|
|
627
|
+
{
|
|
628
|
+
name: 'ContentImageByKey',
|
|
629
|
+
syntax: 'ContentImageByKey(customerKey, altText)',
|
|
630
|
+
description: 'Generates an HTML <img> tag for a Content Builder image referenced by its customer key.',
|
|
631
|
+
category: 'Content',
|
|
632
|
+
params: [
|
|
633
|
+
{ name: 'customerKey', description: 'Customer key of the image asset', type: 'string' },
|
|
634
|
+
{
|
|
635
|
+
name: 'altText',
|
|
636
|
+
description: 'Alt-text for the image',
|
|
637
|
+
type: 'string',
|
|
638
|
+
optional: true,
|
|
639
|
+
},
|
|
640
|
+
],
|
|
641
|
+
returnType: 'string',
|
|
642
|
+
example: '%%=ContentImageByKey("logo-dark", "Company logo")=%%',
|
|
643
|
+
},
|
|
644
|
+
{
|
|
645
|
+
name: 'CreateMSCRMRecord',
|
|
646
|
+
syntax: 'CreateMSCRMRecord(entityName, fieldName1, fieldValue1, fieldName2, fieldValue2...)',
|
|
647
|
+
description: 'Inserts a new record into a Microsoft Dynamics CRM entity and returns its GUID.',
|
|
648
|
+
category: 'Microsoft Dynamics CRM',
|
|
649
|
+
params: [
|
|
650
|
+
{ name: 'entityName', description: 'CRM entity logical name', type: 'string' },
|
|
651
|
+
{ name: 'fieldName1', description: 'First field name', type: 'string' },
|
|
652
|
+
{ name: 'fieldValue1', description: 'First field value', type: 'string' },
|
|
653
|
+
{
|
|
654
|
+
name: 'fieldName2',
|
|
655
|
+
description: 'Additional field name',
|
|
656
|
+
type: 'string',
|
|
657
|
+
optional: true,
|
|
658
|
+
},
|
|
659
|
+
{
|
|
660
|
+
name: 'fieldValue2',
|
|
661
|
+
description: 'Additional field value',
|
|
662
|
+
type: 'string',
|
|
663
|
+
optional: true,
|
|
664
|
+
},
|
|
665
|
+
],
|
|
666
|
+
returnType: 'string',
|
|
667
|
+
example: '%%[\n set @guid = CreateMSCRMRecord("contact", "firstname", @fName, "lastname", @lName)\n]%%',
|
|
668
|
+
},
|
|
669
|
+
{
|
|
670
|
+
name: 'CreateObject',
|
|
671
|
+
syntax: 'CreateObject(objectType)',
|
|
672
|
+
description: 'Instantiates a Marketing Cloud SOAP API object that can later have properties set and be invoked.',
|
|
673
|
+
category: 'Marketing Cloud API',
|
|
674
|
+
params: [
|
|
675
|
+
{
|
|
676
|
+
name: 'objectType',
|
|
677
|
+
description: 'API object type name (e.g. "TriggeredSend")',
|
|
678
|
+
type: 'string',
|
|
679
|
+
},
|
|
680
|
+
],
|
|
681
|
+
returnType: 'object',
|
|
682
|
+
example: '%%[\n set @ts = CreateObject("TriggeredSend")\n]%%',
|
|
683
|
+
},
|
|
684
|
+
{
|
|
685
|
+
name: 'CreateSalesforceObject',
|
|
686
|
+
syntax: 'CreateSalesforceObject(objectName, fieldCount, fieldName1, fieldValue1...)',
|
|
687
|
+
description: 'Creates a new record in a Salesforce standard or custom object. Returns the 18-character record ID.',
|
|
688
|
+
category: 'Sales and Service Cloud',
|
|
689
|
+
params: [
|
|
690
|
+
{
|
|
691
|
+
name: 'objectName',
|
|
692
|
+
description: 'API name of the Salesforce object',
|
|
693
|
+
type: 'string',
|
|
694
|
+
},
|
|
695
|
+
{ name: 'fieldCount', description: 'Number of field name/value pairs', type: 'number' },
|
|
696
|
+
{ name: 'fieldName1', description: 'First field API name', type: 'string' },
|
|
697
|
+
{ name: 'fieldValue1', description: 'First field value', type: 'string' },
|
|
698
|
+
],
|
|
699
|
+
returnType: 'string',
|
|
700
|
+
example: '%%[\n set @sfId = CreateSalesforceObject("Task", 2, "Subject", "Follow-up", "Status", "Open")\n]%%',
|
|
701
|
+
},
|
|
702
|
+
{
|
|
703
|
+
name: 'CreateSmsConversation',
|
|
704
|
+
syntax: 'CreateSmsConversation(shortCode, keyword, mobileNumber, nextKeyword)',
|
|
705
|
+
description: 'Initiates an SMS conversation thread. Returns true on success, false on failure.',
|
|
706
|
+
category: 'MobileConnect',
|
|
707
|
+
params: [
|
|
708
|
+
{ name: 'shortCode', description: 'Short or long code', type: 'string' },
|
|
709
|
+
{ name: 'keyword', description: 'Initial conversation keyword', type: 'string' },
|
|
710
|
+
{ name: 'mobileNumber', description: 'Contact mobile number', type: 'string' },
|
|
711
|
+
{
|
|
712
|
+
name: 'nextKeyword',
|
|
713
|
+
description: 'Keyword for the next expected reply',
|
|
714
|
+
type: 'string',
|
|
715
|
+
},
|
|
716
|
+
],
|
|
717
|
+
returnType: 'boolean',
|
|
718
|
+
example: '%%[\n set @ok = CreateSmsConversation("12345", "JOIN", @mobile, "CONFIRM")\n]%%',
|
|
719
|
+
},
|
|
720
|
+
{
|
|
721
|
+
name: 'DataExtensionRowCount',
|
|
722
|
+
syntax: 'DataExtensionRowCount(dataExtensionName)',
|
|
723
|
+
description: 'Returns the total number of rows in the specified Data Extension.',
|
|
724
|
+
category: 'Data Extension',
|
|
725
|
+
params: [
|
|
726
|
+
{
|
|
727
|
+
name: 'dataExtensionName',
|
|
728
|
+
description: 'Name or external key of the Data Extension',
|
|
729
|
+
type: 'string',
|
|
730
|
+
},
|
|
731
|
+
],
|
|
732
|
+
returnType: 'number',
|
|
733
|
+
example: '%%[\n set @total = DataExtensionRowCount("ContactDirectory")\n]%%',
|
|
734
|
+
},
|
|
735
|
+
{
|
|
736
|
+
name: 'DateAdd',
|
|
737
|
+
syntax: 'DateAdd(date, number, datePart)',
|
|
738
|
+
description: 'Adds a specified interval to a date and returns the resulting date.',
|
|
739
|
+
category: 'Date and Time',
|
|
740
|
+
params: [
|
|
741
|
+
{ name: 'date', description: 'Starting date value', type: 'date' },
|
|
742
|
+
{
|
|
743
|
+
name: 'number',
|
|
744
|
+
description: 'Number of intervals to add (negative to subtract)',
|
|
745
|
+
type: 'number',
|
|
746
|
+
},
|
|
747
|
+
{
|
|
748
|
+
name: 'datePart',
|
|
749
|
+
description: 'Interval type: "Y" (year), "M" (month), "D" (day), "H" (hour), "MI" (minute)',
|
|
750
|
+
type: 'string',
|
|
751
|
+
},
|
|
752
|
+
],
|
|
753
|
+
returnType: 'date',
|
|
754
|
+
example: '%%[\n set @nextWeek = DateAdd(Now(), 7, "D")\n]%%',
|
|
755
|
+
},
|
|
756
|
+
{
|
|
757
|
+
name: 'DateDiff',
|
|
758
|
+
syntax: 'DateDiff(startDate, endDate, datePart)',
|
|
759
|
+
description: 'Calculates the difference between two dates in the specified interval units.',
|
|
760
|
+
category: 'Date and Time',
|
|
761
|
+
params: [
|
|
762
|
+
{ name: 'startDate', description: 'The earlier date', type: 'date' },
|
|
763
|
+
{ name: 'endDate', description: 'The later date', type: 'date' },
|
|
764
|
+
{
|
|
765
|
+
name: 'datePart',
|
|
766
|
+
description: 'Interval type: "Y", "M", "D", "H", "MI"',
|
|
767
|
+
type: 'string',
|
|
768
|
+
},
|
|
769
|
+
],
|
|
770
|
+
returnType: 'number',
|
|
771
|
+
example: '%%[\n set @daysUntilExpiry = DateDiff(Now(), @expirationDate, "D")\n]%%',
|
|
772
|
+
},
|
|
773
|
+
{
|
|
774
|
+
name: 'DateParse',
|
|
775
|
+
syntax: 'DateParse(dateString, convertUTC)',
|
|
776
|
+
description: 'Interprets a date string and converts it into a proper DateTime value.',
|
|
777
|
+
category: 'Date and Time',
|
|
778
|
+
params: [
|
|
779
|
+
{ name: 'dateString', description: 'String representation of a date', type: 'string' },
|
|
780
|
+
{
|
|
781
|
+
name: 'convertUTC',
|
|
782
|
+
description: 'Whether to treat as UTC',
|
|
783
|
+
type: 'boolean',
|
|
784
|
+
optional: true,
|
|
785
|
+
},
|
|
786
|
+
],
|
|
787
|
+
returnType: 'date',
|
|
788
|
+
example: '%%[\n set @dt = DateParse("2026-03-15 14:30:00")\n]%%',
|
|
789
|
+
},
|
|
790
|
+
{
|
|
791
|
+
name: 'DatePart',
|
|
792
|
+
syntax: 'DatePart(date, datePart)',
|
|
793
|
+
description: 'Extracts a specific component (year, month, day, etc.) from a date value.',
|
|
794
|
+
category: 'Date and Time',
|
|
795
|
+
params: [
|
|
796
|
+
{ name: 'date', description: 'Input date value', type: 'date' },
|
|
797
|
+
{
|
|
798
|
+
name: 'datePart',
|
|
799
|
+
description: 'Component to extract: "Y", "M", "D", "H", "MI"',
|
|
800
|
+
type: 'string',
|
|
801
|
+
},
|
|
802
|
+
],
|
|
803
|
+
returnType: 'number',
|
|
804
|
+
example: '%%[\n set @currentMonth = DatePart(Now(), "M")\n]%%',
|
|
805
|
+
},
|
|
806
|
+
{
|
|
807
|
+
name: 'DecryptSymmetric',
|
|
808
|
+
syntax: 'DecryptSymmetric(cipherText, algorithm, passwordExternalKey, password, saltExternalKey, salt, ivExternalKey, iv)',
|
|
809
|
+
description: 'Decrypts a previously encrypted string using a symmetric algorithm and the matching key material.',
|
|
810
|
+
category: 'Encryption and Encoding',
|
|
811
|
+
params: [
|
|
812
|
+
{
|
|
813
|
+
name: 'cipherText',
|
|
814
|
+
description: 'Encrypted Base64 string to decrypt',
|
|
815
|
+
type: 'string',
|
|
816
|
+
},
|
|
817
|
+
{ name: 'algorithm', description: 'Algorithm name (e.g. "AES")', type: 'string' },
|
|
818
|
+
{
|
|
819
|
+
name: 'passwordExternalKey',
|
|
820
|
+
description: 'External key for the password in Key Management',
|
|
821
|
+
type: 'string',
|
|
822
|
+
},
|
|
823
|
+
{
|
|
824
|
+
name: 'password',
|
|
825
|
+
description: 'Password string (use empty string if using external key)',
|
|
826
|
+
type: 'string',
|
|
827
|
+
},
|
|
828
|
+
{ name: 'saltExternalKey', description: 'External key for the salt', type: 'string' },
|
|
829
|
+
{ name: 'salt', description: 'Salt string', type: 'string' },
|
|
830
|
+
{
|
|
831
|
+
name: 'ivExternalKey',
|
|
832
|
+
description: 'External key for the initialization vector',
|
|
833
|
+
type: 'string',
|
|
834
|
+
},
|
|
835
|
+
{ name: 'iv', description: 'Initialization vector string', type: 'string' },
|
|
836
|
+
],
|
|
837
|
+
returnType: 'string',
|
|
838
|
+
example: '%%[\n set @plain = DecryptSymmetric(@cipher, "AES", "pwd-key", "", "salt-key", "", "iv-key", "")\n]%%',
|
|
839
|
+
},
|
|
840
|
+
{
|
|
841
|
+
name: 'DeleteData',
|
|
842
|
+
syntax: 'DeleteData(dataExtension, column1, value1, column2, value2...)',
|
|
843
|
+
description: 'Removes rows from a Data Extension matching the given column/value criteria. Returns the count of deleted rows. Landing pages and CloudPages only.',
|
|
844
|
+
category: 'Data Extension',
|
|
845
|
+
params: [
|
|
846
|
+
{ name: 'dataExtension', description: 'Name of the Data Extension', type: 'string' },
|
|
847
|
+
{ name: 'column1', description: 'First match column name', type: 'string' },
|
|
848
|
+
{ name: 'value1', description: 'Value to match in column1', type: 'string' },
|
|
849
|
+
{
|
|
850
|
+
name: 'column2',
|
|
851
|
+
description: 'Additional match column',
|
|
852
|
+
type: 'string',
|
|
853
|
+
optional: true,
|
|
854
|
+
},
|
|
855
|
+
{
|
|
856
|
+
name: 'value2',
|
|
857
|
+
description: 'Additional match value',
|
|
858
|
+
type: 'string',
|
|
859
|
+
optional: true,
|
|
860
|
+
},
|
|
861
|
+
],
|
|
862
|
+
returnType: 'number',
|
|
863
|
+
example: '%%[\n set @removed = DeleteData("TempCart", "SessionId", @sid)\n]%%',
|
|
864
|
+
},
|
|
865
|
+
{
|
|
866
|
+
name: 'DeleteDE',
|
|
867
|
+
syntax: 'DeleteDE(dataExtension, column1, value1, column2, value2...)',
|
|
868
|
+
description: 'Removes rows from a Data Extension matching the given criteria. Email sends only (no return value).',
|
|
869
|
+
category: 'Data Extension',
|
|
870
|
+
params: [
|
|
871
|
+
{ name: 'dataExtension', description: 'Name of the Data Extension', type: 'string' },
|
|
872
|
+
{ name: 'column1', description: 'First match column name', type: 'string' },
|
|
873
|
+
{ name: 'value1', description: 'Value to match', type: 'string' },
|
|
874
|
+
{
|
|
875
|
+
name: 'column2',
|
|
876
|
+
description: 'Additional match column',
|
|
877
|
+
type: 'string',
|
|
878
|
+
optional: true,
|
|
879
|
+
},
|
|
880
|
+
{
|
|
881
|
+
name: 'value2',
|
|
882
|
+
description: 'Additional match value',
|
|
883
|
+
type: 'string',
|
|
884
|
+
optional: true,
|
|
885
|
+
},
|
|
886
|
+
],
|
|
887
|
+
returnType: 'void',
|
|
888
|
+
example: '%%[\n DeleteDE("PendingNotifications", "SubscriberKey", _subscriberKey)\n]%%',
|
|
889
|
+
},
|
|
890
|
+
{
|
|
891
|
+
name: 'DescribeMSCRMEntities',
|
|
892
|
+
syntax: 'DescribeMSCRMEntities()',
|
|
893
|
+
description: 'Returns the logical and display names for all entity types in the connected Dynamics CRM org.',
|
|
894
|
+
category: 'Microsoft Dynamics CRM',
|
|
895
|
+
params: [],
|
|
896
|
+
returnType: 'rowset',
|
|
897
|
+
example: '%%[\n set @entities = DescribeMSCRMEntities()\n]%%',
|
|
898
|
+
},
|
|
899
|
+
{
|
|
900
|
+
name: 'DescribeMSCRMEntityAttributes',
|
|
901
|
+
syntax: 'DescribeMSCRMEntityAttributes(entityName)',
|
|
902
|
+
description: 'Returns attribute metadata (logical name, display name, data type) for the specified CRM entity.',
|
|
903
|
+
category: 'Microsoft Dynamics CRM',
|
|
904
|
+
params: [
|
|
905
|
+
{ name: 'entityName', description: 'Logical name of the CRM entity', type: 'string' },
|
|
906
|
+
],
|
|
907
|
+
returnType: 'rowset',
|
|
908
|
+
example: '%%[\n set @attrs = DescribeMSCRMEntityAttributes("account")\n]%%',
|
|
909
|
+
},
|
|
910
|
+
{
|
|
911
|
+
name: 'Divide',
|
|
912
|
+
syntax: 'Divide(dividend, divisor)',
|
|
913
|
+
description: 'Divides the first number by the second and returns the quotient.',
|
|
914
|
+
category: 'Math',
|
|
915
|
+
params: [
|
|
916
|
+
{ name: 'dividend', description: 'The number to be divided', type: 'number' },
|
|
917
|
+
{ name: 'divisor', description: 'The number to divide by', type: 'number' },
|
|
918
|
+
],
|
|
919
|
+
returnType: 'number',
|
|
920
|
+
example: '%%[\n set @average = Divide(@totalScore, @numEntries)\n]%%',
|
|
921
|
+
},
|
|
922
|
+
{
|
|
923
|
+
name: 'Domain',
|
|
924
|
+
syntax: 'Domain(emailAddress)',
|
|
925
|
+
description: 'Extracts the domain portion (everything after @) from an email address string.',
|
|
926
|
+
category: 'Utility',
|
|
927
|
+
params: [
|
|
928
|
+
{ name: 'emailAddress', description: 'A valid email address string', type: 'string' },
|
|
929
|
+
],
|
|
930
|
+
returnType: 'string',
|
|
931
|
+
example: '%%[\n set @dom = Domain("user@example.com")\n /* result: "example.com" */\n]%%',
|
|
932
|
+
},
|
|
933
|
+
{
|
|
934
|
+
name: 'Empty',
|
|
935
|
+
syntax: 'Empty(expression)',
|
|
936
|
+
description: 'Tests whether a value is null or an empty string. Returns true if so, false otherwise.',
|
|
937
|
+
category: 'Utility',
|
|
938
|
+
params: [
|
|
939
|
+
{ name: 'expression', description: 'Value or expression to test', type: 'string' },
|
|
940
|
+
],
|
|
941
|
+
returnType: 'boolean',
|
|
942
|
+
example: '%%[\n if Empty(@lastName) then\n set @lastName = "Valued Customer"\n endif\n]%%',
|
|
943
|
+
},
|
|
944
|
+
{
|
|
945
|
+
name: 'EncryptSymmetric',
|
|
946
|
+
syntax: 'EncryptSymmetric(plainText, algorithm, passwordExternalKey, password, saltExternalKey, salt, ivExternalKey, iv)',
|
|
947
|
+
description: 'Encrypts a string using a symmetric algorithm and returns the result as Base64.',
|
|
948
|
+
category: 'Encryption and Encoding',
|
|
949
|
+
params: [
|
|
950
|
+
{ name: 'plainText', description: 'String to encrypt', type: 'string' },
|
|
951
|
+
{ name: 'algorithm', description: 'Algorithm name (e.g. "AES")', type: 'string' },
|
|
952
|
+
{
|
|
953
|
+
name: 'passwordExternalKey',
|
|
954
|
+
description: 'External key for password in Key Management',
|
|
955
|
+
type: 'string',
|
|
956
|
+
},
|
|
957
|
+
{ name: 'password', description: 'Password string', type: 'string' },
|
|
958
|
+
{ name: 'saltExternalKey', description: 'External key for salt', type: 'string' },
|
|
959
|
+
{ name: 'salt', description: 'Salt string', type: 'string' },
|
|
960
|
+
{ name: 'ivExternalKey', description: 'External key for IV', type: 'string' },
|
|
961
|
+
{ name: 'iv', description: 'Initialization vector string', type: 'string' },
|
|
962
|
+
],
|
|
963
|
+
returnType: 'string',
|
|
964
|
+
example: '%%[\n set @encrypted = EncryptSymmetric(@ssn, "AES", "pwd-key", "", "salt-key", "", "iv-key", "")\n]%%',
|
|
965
|
+
},
|
|
966
|
+
{
|
|
967
|
+
name: 'EndImpressionRegion',
|
|
968
|
+
syntax: 'EndImpressionRegion(endOutput)',
|
|
969
|
+
description: 'Closes a previously opened impression region started with BeginImpressionRegion.',
|
|
970
|
+
category: 'Content',
|
|
971
|
+
params: [
|
|
972
|
+
{
|
|
973
|
+
name: 'endOutput',
|
|
974
|
+
description: 'Pass true to include region end output',
|
|
975
|
+
type: 'boolean',
|
|
976
|
+
optional: true,
|
|
977
|
+
},
|
|
978
|
+
],
|
|
979
|
+
returnType: 'void',
|
|
980
|
+
example: '%%=EndImpressionRegion(true)=%%',
|
|
981
|
+
},
|
|
982
|
+
{
|
|
983
|
+
name: 'EndSmsConversation',
|
|
984
|
+
syntax: 'EndSmsConversation(shortCode, mobileNumber)',
|
|
985
|
+
description: 'Terminates an active SMS conversation. Returns true on success, false on failure.',
|
|
986
|
+
category: 'MobileConnect',
|
|
987
|
+
params: [
|
|
988
|
+
{ name: 'shortCode', description: 'The short or long code', type: 'string' },
|
|
989
|
+
{ name: 'mobileNumber', description: 'Contact mobile number', type: 'string' },
|
|
990
|
+
],
|
|
991
|
+
returnType: 'boolean',
|
|
992
|
+
example: '%%[\n set @ended = EndSmsConversation("12345", @phone)\n]%%',
|
|
993
|
+
},
|
|
994
|
+
{
|
|
995
|
+
name: 'ExecuteFilter',
|
|
996
|
+
syntax: 'ExecuteFilter(filterName)',
|
|
997
|
+
description: 'Runs a pre-defined Data Extension filter and returns the matching rows as a row set.',
|
|
998
|
+
category: 'Data Extension',
|
|
999
|
+
params: [
|
|
1000
|
+
{
|
|
1001
|
+
name: 'filterName',
|
|
1002
|
+
description: 'Name of the Data Filter to execute',
|
|
1003
|
+
type: 'string',
|
|
1004
|
+
},
|
|
1005
|
+
],
|
|
1006
|
+
returnType: 'rowset',
|
|
1007
|
+
example: '%%[\n set @results = ExecuteFilter("EngagedContacts")\n]%%',
|
|
1008
|
+
},
|
|
1009
|
+
{
|
|
1010
|
+
name: 'ExecuteFilterOrderedRows',
|
|
1011
|
+
syntax: 'ExecuteFilterOrderedRows(filterName, maxRows, sortColumn)',
|
|
1012
|
+
description: 'Runs a Data Extension filter and returns a sorted row set with a maximum row count.',
|
|
1013
|
+
category: 'Data Extension',
|
|
1014
|
+
params: [
|
|
1015
|
+
{ name: 'filterName', description: 'Name of the Data Filter', type: 'string' },
|
|
1016
|
+
{ name: 'maxRows', description: 'Maximum number of rows to return', type: 'number' },
|
|
1017
|
+
{
|
|
1018
|
+
name: 'sortColumn',
|
|
1019
|
+
description: 'Column to sort by (prefix with "ASC " or "DESC ")',
|
|
1020
|
+
type: 'string',
|
|
1021
|
+
},
|
|
1022
|
+
],
|
|
1023
|
+
returnType: 'rowset',
|
|
1024
|
+
example: '%%[\n set @topResults = ExecuteFilterOrderedRows("EngagedContacts", 10, "DESC LastInteraction")\n]%%',
|
|
1025
|
+
},
|
|
1026
|
+
{
|
|
1027
|
+
name: 'Field',
|
|
1028
|
+
syntax: 'Field(row, columnName, ordinal)',
|
|
1029
|
+
description: 'Extracts a column value from a single row (returned by Row, ClaimRow, etc.) or from an API object property.',
|
|
1030
|
+
category: 'Data Extension',
|
|
1031
|
+
params: [
|
|
1032
|
+
{ name: 'row', description: 'Row object to read from', type: 'row' },
|
|
1033
|
+
{ name: 'columnName', description: 'Name of the column/field', type: 'string' },
|
|
1034
|
+
{
|
|
1035
|
+
name: 'ordinal',
|
|
1036
|
+
description: 'Zero-based index for multi-value properties',
|
|
1037
|
+
type: 'number',
|
|
1038
|
+
optional: true,
|
|
1039
|
+
},
|
|
1040
|
+
],
|
|
1041
|
+
returnType: 'string',
|
|
1042
|
+
example: '%%[\n set @name = Field(@row, "FullName")\n]%%',
|
|
1043
|
+
},
|
|
1044
|
+
{
|
|
1045
|
+
name: 'Format',
|
|
1046
|
+
syntax: 'Format(value, formatPattern, locale, currencyCode)',
|
|
1047
|
+
description: 'Formats a value according to a .NET-style format pattern, optionally with a locale.',
|
|
1048
|
+
category: 'Utility',
|
|
1049
|
+
params: [
|
|
1050
|
+
{ name: 'value', description: 'Value to format', type: 'string' },
|
|
1051
|
+
{
|
|
1052
|
+
name: 'formatPattern',
|
|
1053
|
+
description: 'Format string (e.g. "C2", "N0", "yyyy-MM-dd")',
|
|
1054
|
+
type: 'string',
|
|
1055
|
+
},
|
|
1056
|
+
{
|
|
1057
|
+
name: 'locale',
|
|
1058
|
+
description: 'Culture code (e.g. "en-US")',
|
|
1059
|
+
type: 'string',
|
|
1060
|
+
optional: true,
|
|
1061
|
+
},
|
|
1062
|
+
{
|
|
1063
|
+
name: 'currencyCode',
|
|
1064
|
+
description: 'ISO currency code',
|
|
1065
|
+
type: 'string',
|
|
1066
|
+
optional: true,
|
|
1067
|
+
},
|
|
1068
|
+
],
|
|
1069
|
+
returnType: 'string',
|
|
1070
|
+
example: '%%[\n set @price = Format(49.9, "C2", "en-US")\n /* result: "$49.90" */\n]%%',
|
|
1071
|
+
},
|
|
1072
|
+
{
|
|
1073
|
+
name: 'FormatCurrency',
|
|
1074
|
+
syntax: 'FormatCurrency(amount, locale, decimals, symbol)',
|
|
1075
|
+
description: 'Renders a numeric value as a formatted currency string for the specified locale.',
|
|
1076
|
+
category: 'Utility',
|
|
1077
|
+
params: [
|
|
1078
|
+
{ name: 'amount', description: 'Numeric amount to format', type: 'number' },
|
|
1079
|
+
{ name: 'locale', description: 'Culture code (e.g. "de-DE")', type: 'string' },
|
|
1080
|
+
{
|
|
1081
|
+
name: 'decimals',
|
|
1082
|
+
description: 'Number of decimal places',
|
|
1083
|
+
type: 'number',
|
|
1084
|
+
optional: true,
|
|
1085
|
+
},
|
|
1086
|
+
{
|
|
1087
|
+
name: 'symbol',
|
|
1088
|
+
description: 'Custom currency symbol',
|
|
1089
|
+
type: 'string',
|
|
1090
|
+
optional: true,
|
|
1091
|
+
},
|
|
1092
|
+
],
|
|
1093
|
+
returnType: 'string',
|
|
1094
|
+
example: '%%[\n set @euroPrice = FormatCurrency(@amount, "de-DE", 2)\n]%%',
|
|
1095
|
+
},
|
|
1096
|
+
{
|
|
1097
|
+
name: 'FormatDate',
|
|
1098
|
+
syntax: 'FormatDate(date, formatType, formatPattern, locale)',
|
|
1099
|
+
description: 'Converts a date into a formatted string using a format type or custom pattern.',
|
|
1100
|
+
category: 'Date and Time',
|
|
1101
|
+
params: [
|
|
1102
|
+
{ name: 'date', description: 'Date value to format', type: 'date' },
|
|
1103
|
+
{
|
|
1104
|
+
name: 'formatType',
|
|
1105
|
+
description: '"S" (short), "L" (long), "SM" (short month), etc.',
|
|
1106
|
+
type: 'string',
|
|
1107
|
+
},
|
|
1108
|
+
{
|
|
1109
|
+
name: 'formatPattern',
|
|
1110
|
+
description: 'Custom .NET date format pattern',
|
|
1111
|
+
type: 'string',
|
|
1112
|
+
optional: true,
|
|
1113
|
+
},
|
|
1114
|
+
{ name: 'locale', description: 'Culture code', type: 'string', optional: true },
|
|
1115
|
+
],
|
|
1116
|
+
returnType: 'string',
|
|
1117
|
+
example: '%%[\n set @fmtDate = FormatDate(Now(), "S")\n /* e.g. "3/26/2026" */\n]%%',
|
|
1118
|
+
},
|
|
1119
|
+
{
|
|
1120
|
+
name: 'FormatNumber',
|
|
1121
|
+
syntax: 'FormatNumber(number, formatPattern, locale)',
|
|
1122
|
+
description: 'Formats a numeric value using a .NET-style number format pattern.',
|
|
1123
|
+
category: 'Utility',
|
|
1124
|
+
params: [
|
|
1125
|
+
{ name: 'number', description: 'Numeric value to format', type: 'number' },
|
|
1126
|
+
{
|
|
1127
|
+
name: 'formatPattern',
|
|
1128
|
+
description: 'Format string (e.g. "N2", "P0")',
|
|
1129
|
+
type: 'string',
|
|
1130
|
+
},
|
|
1131
|
+
{ name: 'locale', description: 'Culture code', type: 'string', optional: true },
|
|
1132
|
+
],
|
|
1133
|
+
returnType: 'string',
|
|
1134
|
+
example: '%%[\n set @formatted = FormatNumber(12345.6, "N2")\n /* result: "12,345.60" */\n]%%',
|
|
1135
|
+
},
|
|
1136
|
+
{
|
|
1137
|
+
name: 'GetJWT',
|
|
1138
|
+
syntax: 'GetJWT(payload, algorithm, secret)',
|
|
1139
|
+
description: 'Creates a JSON Web Token from a JSON payload using a hard-coded secret.',
|
|
1140
|
+
category: 'Encryption and Encoding',
|
|
1141
|
+
params: [
|
|
1142
|
+
{ name: 'payload', description: 'JSON string payload', type: 'string' },
|
|
1143
|
+
{ name: 'algorithm', description: 'Signing algorithm (e.g. "HS256")', type: 'string' },
|
|
1144
|
+
{ name: 'secret', description: 'Secret key for signing', type: 'string' },
|
|
1145
|
+
],
|
|
1146
|
+
returnType: 'string',
|
|
1147
|
+
example: '%%[\n set @jwt = GetJWT(\'{"sub":"user1"}\', "HS256", @secret)\n]%%',
|
|
1148
|
+
},
|
|
1149
|
+
{
|
|
1150
|
+
name: 'GetJWTByKeyName',
|
|
1151
|
+
syntax: 'GetJWTByKeyName(payload, algorithm, keyName)',
|
|
1152
|
+
description: 'Creates a JSON Web Token using a secret stored in Marketing Cloud Key Management.',
|
|
1153
|
+
category: 'Encryption and Encoding',
|
|
1154
|
+
params: [
|
|
1155
|
+
{ name: 'payload', description: 'JSON string payload', type: 'string' },
|
|
1156
|
+
{ name: 'algorithm', description: 'Signing algorithm', type: 'string' },
|
|
1157
|
+
{ name: 'keyName', description: 'External key name in Key Management', type: 'string' },
|
|
1158
|
+
],
|
|
1159
|
+
returnType: 'string',
|
|
1160
|
+
example: '%%[\n set @jwt = GetJWTByKeyName(\'{"sub":"user1"}\', "HS256", "my-jwt-key")\n]%%',
|
|
1161
|
+
},
|
|
1162
|
+
{
|
|
1163
|
+
name: 'GetPortfolioItem',
|
|
1164
|
+
syntax: 'GetPortfolioItem(customerKey)',
|
|
1165
|
+
description: 'Returns the content of a Portfolio item identified by its customer/external key.',
|
|
1166
|
+
category: 'Content',
|
|
1167
|
+
params: [
|
|
1168
|
+
{
|
|
1169
|
+
name: 'customerKey',
|
|
1170
|
+
description: 'Customer key of the Portfolio item',
|
|
1171
|
+
type: 'string',
|
|
1172
|
+
},
|
|
1173
|
+
],
|
|
1174
|
+
returnType: 'string',
|
|
1175
|
+
example: '%%=GetPortfolioItem("legal-disclaimer")=%%',
|
|
1176
|
+
},
|
|
1177
|
+
{
|
|
1178
|
+
name: 'GetPublishedSocialContent',
|
|
1179
|
+
syntax: 'GetPublishedSocialContent(regionID)',
|
|
1180
|
+
description: 'Retrieves previously published social content by its region identifier.',
|
|
1181
|
+
category: 'Social',
|
|
1182
|
+
params: [
|
|
1183
|
+
{
|
|
1184
|
+
name: 'regionID',
|
|
1185
|
+
description: 'ID of the published social content region',
|
|
1186
|
+
type: 'number',
|
|
1187
|
+
},
|
|
1188
|
+
],
|
|
1189
|
+
returnType: 'string',
|
|
1190
|
+
example: '%%=GetPublishedSocialContent(42)=%%',
|
|
1191
|
+
},
|
|
1192
|
+
{
|
|
1193
|
+
name: 'GetSendTime',
|
|
1194
|
+
syntax: 'GetSendTime(useCompletedTime)',
|
|
1195
|
+
description: 'Returns the date/time the email send was initiated (or completed). Time is in Central Standard Time.',
|
|
1196
|
+
category: 'Date and Time',
|
|
1197
|
+
params: [
|
|
1198
|
+
{
|
|
1199
|
+
name: 'useCompletedTime',
|
|
1200
|
+
description: 'Pass true to get completion time instead of start time',
|
|
1201
|
+
type: 'boolean',
|
|
1202
|
+
optional: true,
|
|
1203
|
+
},
|
|
1204
|
+
],
|
|
1205
|
+
returnType: 'date',
|
|
1206
|
+
example: '%%[\n set @sentAt = GetSendTime(false)\n]%%',
|
|
1207
|
+
},
|
|
1208
|
+
{
|
|
1209
|
+
name: 'GetSocialPublishURL',
|
|
1210
|
+
syntax: 'GetSocialPublishURL(socialNetworkCode, regionID, param1, param2...)',
|
|
1211
|
+
description: 'Generates a social sharing URL/HTML snippet for a content impression region using a network code.',
|
|
1212
|
+
category: 'Social',
|
|
1213
|
+
params: [
|
|
1214
|
+
{
|
|
1215
|
+
name: 'socialNetworkCode',
|
|
1216
|
+
description: 'Numeric code for the social network',
|
|
1217
|
+
type: 'number',
|
|
1218
|
+
},
|
|
1219
|
+
{ name: 'regionID', description: 'Impression region identifier', type: 'string' },
|
|
1220
|
+
{
|
|
1221
|
+
name: 'param1',
|
|
1222
|
+
description: 'Additional parameters',
|
|
1223
|
+
type: 'string',
|
|
1224
|
+
optional: true,
|
|
1225
|
+
},
|
|
1226
|
+
],
|
|
1227
|
+
returnType: 'string',
|
|
1228
|
+
example: '%%=GetSocialPublishURL(1, "deal-of-day")=%%',
|
|
1229
|
+
},
|
|
1230
|
+
{
|
|
1231
|
+
name: 'GetSocialPublishURLByName',
|
|
1232
|
+
syntax: 'GetSocialPublishURLByName(networkName, regionID, param1, param2...)',
|
|
1233
|
+
description: 'Generates a social sharing URL/HTML snippet for a content impression region using a network name.',
|
|
1234
|
+
category: 'Social',
|
|
1235
|
+
params: [
|
|
1236
|
+
{
|
|
1237
|
+
name: 'networkName',
|
|
1238
|
+
description: 'Name of the social network (e.g. "Facebook")',
|
|
1239
|
+
type: 'string',
|
|
1240
|
+
},
|
|
1241
|
+
{ name: 'regionID', description: 'Impression region identifier', type: 'string' },
|
|
1242
|
+
{
|
|
1243
|
+
name: 'param1',
|
|
1244
|
+
description: 'Additional parameters',
|
|
1245
|
+
type: 'string',
|
|
1246
|
+
optional: true,
|
|
1247
|
+
},
|
|
1248
|
+
],
|
|
1249
|
+
returnType: 'string',
|
|
1250
|
+
example: '%%=GetSocialPublishURLByName("Facebook", "deal-of-day")=%%',
|
|
1251
|
+
},
|
|
1252
|
+
{
|
|
1253
|
+
name: 'GetValue',
|
|
1254
|
+
syntax: 'GetValue(variableName)',
|
|
1255
|
+
description: 'Returns the value of an AMPscript variable or subscriber attribute. Primarily used from Server-Side JavaScript context.',
|
|
1256
|
+
category: 'Utility',
|
|
1257
|
+
params: [
|
|
1258
|
+
{
|
|
1259
|
+
name: 'variableName',
|
|
1260
|
+
description: 'Variable or attribute name (without @ prefix in SSJS)',
|
|
1261
|
+
type: 'string',
|
|
1262
|
+
},
|
|
1263
|
+
],
|
|
1264
|
+
returnType: 'string',
|
|
1265
|
+
example: '/* In SSJS: */\nvar name = Variable.GetValue("@displayName");',
|
|
1266
|
+
},
|
|
1267
|
+
{
|
|
1268
|
+
name: 'GUID',
|
|
1269
|
+
syntax: 'GUID()',
|
|
1270
|
+
description: 'Generates a new 36-character globally unique identifier string.',
|
|
1271
|
+
category: 'Utility',
|
|
1272
|
+
params: [],
|
|
1273
|
+
returnType: 'string',
|
|
1274
|
+
example: '%%[\n set @uniqueId = GUID()\n /* e.g. "a1b2c3d4-e5f6-7890-abcd-ef1234567890" */\n]%%',
|
|
1275
|
+
},
|
|
1276
|
+
{
|
|
1277
|
+
name: 'HTTPGet',
|
|
1278
|
+
syntax: 'HTTPGet(url, continueOnError, emptyOnError, headerName)',
|
|
1279
|
+
description: 'Performs an HTTP GET request to a publicly accessible URL and returns the response body.',
|
|
1280
|
+
category: 'HTTP',
|
|
1281
|
+
params: [
|
|
1282
|
+
{ name: 'url', description: 'Target URL', type: 'string' },
|
|
1283
|
+
{
|
|
1284
|
+
name: 'continueOnError',
|
|
1285
|
+
description: 'Whether to continue execution on HTTP error',
|
|
1286
|
+
type: 'boolean',
|
|
1287
|
+
optional: true,
|
|
1288
|
+
},
|
|
1289
|
+
{
|
|
1290
|
+
name: 'emptyOnError',
|
|
1291
|
+
description: 'Whether to return empty string on error',
|
|
1292
|
+
type: 'boolean',
|
|
1293
|
+
optional: true,
|
|
1294
|
+
},
|
|
1295
|
+
{
|
|
1296
|
+
name: 'headerName',
|
|
1297
|
+
description: 'Variable to receive response header values',
|
|
1298
|
+
type: 'string',
|
|
1299
|
+
optional: true,
|
|
1300
|
+
},
|
|
1301
|
+
],
|
|
1302
|
+
returnType: 'string',
|
|
1303
|
+
example: '%%[\n set @response = HTTPGet("https://api.example.com/data")\n]%%',
|
|
1304
|
+
},
|
|
1305
|
+
{
|
|
1306
|
+
name: 'HTTPPost',
|
|
1307
|
+
syntax: 'HTTPPost(url, contentType, payload, responseVar, headerVar, headerName, headerValue...)',
|
|
1308
|
+
description: 'Sends an HTTP POST request to a publicly accessible URL. Response body and headers can be captured in variables.',
|
|
1309
|
+
category: 'HTTP',
|
|
1310
|
+
params: [
|
|
1311
|
+
{ name: 'url', description: 'Target URL', type: 'string' },
|
|
1312
|
+
{ name: 'contentType', description: 'Content-Type header value', type: 'string' },
|
|
1313
|
+
{ name: 'payload', description: 'Request body', type: 'string' },
|
|
1314
|
+
{
|
|
1315
|
+
name: 'responseVar',
|
|
1316
|
+
description: 'Variable name to store the response body',
|
|
1317
|
+
type: 'string',
|
|
1318
|
+
},
|
|
1319
|
+
{
|
|
1320
|
+
name: 'headerVar',
|
|
1321
|
+
description: 'Variable name for response headers',
|
|
1322
|
+
type: 'string',
|
|
1323
|
+
optional: true,
|
|
1324
|
+
},
|
|
1325
|
+
{
|
|
1326
|
+
name: 'headerName',
|
|
1327
|
+
description: 'Custom request header name',
|
|
1328
|
+
type: 'string',
|
|
1329
|
+
optional: true,
|
|
1330
|
+
},
|
|
1331
|
+
{
|
|
1332
|
+
name: 'headerValue',
|
|
1333
|
+
description: 'Custom request header value',
|
|
1334
|
+
type: 'string',
|
|
1335
|
+
optional: true,
|
|
1336
|
+
},
|
|
1337
|
+
],
|
|
1338
|
+
returnType: 'string',
|
|
1339
|
+
example: '%%[\n HTTPPost("https://api.example.com/submit", "application/json", @body, @resp)\n]%%',
|
|
1340
|
+
},
|
|
1341
|
+
{
|
|
1342
|
+
name: 'HTTPPost2',
|
|
1343
|
+
syntax: 'HTTPPost2(url, contentType, payload, continueOnError, responseVar, headerVar, statusVar, headerName, headerValue...)',
|
|
1344
|
+
description: 'Like HTTPPost, but adds error handling: captures response body and status separately even on HTTP errors.',
|
|
1345
|
+
category: 'HTTP',
|
|
1346
|
+
params: [
|
|
1347
|
+
{ name: 'url', description: 'Target URL', type: 'string' },
|
|
1348
|
+
{ name: 'contentType', description: 'Content-Type header value', type: 'string' },
|
|
1349
|
+
{ name: 'payload', description: 'Request body', type: 'string' },
|
|
1350
|
+
{ name: 'continueOnError', description: 'Whether to suppress errors', type: 'boolean' },
|
|
1351
|
+
{ name: 'responseVar', description: 'Variable for response body', type: 'string' },
|
|
1352
|
+
{ name: 'headerVar', description: 'Variable for response headers', type: 'string' },
|
|
1353
|
+
{ name: 'statusVar', description: 'Variable for HTTP status code', type: 'string' },
|
|
1354
|
+
{
|
|
1355
|
+
name: 'headerName',
|
|
1356
|
+
description: 'Custom header name',
|
|
1357
|
+
type: 'string',
|
|
1358
|
+
optional: true,
|
|
1359
|
+
},
|
|
1360
|
+
{
|
|
1361
|
+
name: 'headerValue',
|
|
1362
|
+
description: 'Custom header value',
|
|
1363
|
+
type: 'string',
|
|
1364
|
+
optional: true,
|
|
1365
|
+
},
|
|
1366
|
+
],
|
|
1367
|
+
returnType: 'string',
|
|
1368
|
+
example: '%%[\n HTTPPost2(@apiUrl, "application/json", @payload, true, @resp, @hdrs, @status)\n]%%',
|
|
1369
|
+
},
|
|
1370
|
+
{
|
|
1371
|
+
name: 'HTTPPostWithRetry',
|
|
1372
|
+
syntax: 'HTTPPostWithRetry(url, contentType, payload, maxRetries, responseVar, headerVar, statusVar, headerName, headerValue...)',
|
|
1373
|
+
description: 'Similar to HTTPPost2 but adds automatic retries on failure.',
|
|
1374
|
+
category: 'HTTP',
|
|
1375
|
+
params: [
|
|
1376
|
+
{ name: 'url', description: 'Target URL', type: 'string' },
|
|
1377
|
+
{ name: 'contentType', description: 'Content-Type header value', type: 'string' },
|
|
1378
|
+
{ name: 'payload', description: 'Request body', type: 'string' },
|
|
1379
|
+
{ name: 'maxRetries', description: 'Number of retry attempts', type: 'number' },
|
|
1380
|
+
{ name: 'responseVar', description: 'Variable for response body', type: 'string' },
|
|
1381
|
+
{ name: 'headerVar', description: 'Variable for response headers', type: 'string' },
|
|
1382
|
+
{ name: 'statusVar', description: 'Variable for HTTP status code', type: 'string' },
|
|
1383
|
+
{
|
|
1384
|
+
name: 'headerName',
|
|
1385
|
+
description: 'Custom header name',
|
|
1386
|
+
type: 'string',
|
|
1387
|
+
optional: true,
|
|
1388
|
+
},
|
|
1389
|
+
{
|
|
1390
|
+
name: 'headerValue',
|
|
1391
|
+
description: 'Custom header value',
|
|
1392
|
+
type: 'string',
|
|
1393
|
+
optional: true,
|
|
1394
|
+
},
|
|
1395
|
+
],
|
|
1396
|
+
returnType: 'string',
|
|
1397
|
+
example: '%%[\n HTTPPostWithRetry(@apiUrl, "application/json", @payload, 3, @resp, @hdrs, @status)\n]%%',
|
|
1398
|
+
},
|
|
1399
|
+
{
|
|
1400
|
+
name: 'HTTPRequestHeader',
|
|
1401
|
+
syntax: 'HTTPRequestHeader(headerName)',
|
|
1402
|
+
description: 'Reads a specific header from the incoming HTTP request. Only available on landing pages and CloudPages.',
|
|
1403
|
+
category: 'HTTP',
|
|
1404
|
+
params: [
|
|
1405
|
+
{ name: 'headerName', description: 'Name of the HTTP request header', type: 'string' },
|
|
1406
|
+
],
|
|
1407
|
+
returnType: 'string',
|
|
1408
|
+
example: '%%[\n set @userAgent = HTTPRequestHeader("User-Agent")\n]%%',
|
|
1409
|
+
},
|
|
1410
|
+
{
|
|
1411
|
+
name: 'IIf',
|
|
1412
|
+
syntax: 'IIf(condition, trueValue, falseValue)',
|
|
1413
|
+
description: 'Inline conditional: returns the second argument when the condition is true, otherwise returns the third.',
|
|
1414
|
+
category: 'Utility',
|
|
1415
|
+
params: [
|
|
1416
|
+
{ name: 'condition', description: 'Boolean expression to evaluate', type: 'boolean' },
|
|
1417
|
+
{
|
|
1418
|
+
name: 'trueValue',
|
|
1419
|
+
description: 'Value returned when condition is true',
|
|
1420
|
+
type: 'string',
|
|
1421
|
+
},
|
|
1422
|
+
{
|
|
1423
|
+
name: 'falseValue',
|
|
1424
|
+
description: 'Value returned when condition is false',
|
|
1425
|
+
type: 'string',
|
|
1426
|
+
},
|
|
1427
|
+
],
|
|
1428
|
+
returnType: 'string',
|
|
1429
|
+
example: '%%[\n set @label = IIf(@qty > 1, "items", "item")\n]%%',
|
|
1430
|
+
},
|
|
1431
|
+
{
|
|
1432
|
+
name: 'Image',
|
|
1433
|
+
syntax: 'Image(imageIdentifier, altText)',
|
|
1434
|
+
description: 'Produces an HTML <img> tag from a Portfolio image asset.',
|
|
1435
|
+
category: 'Content',
|
|
1436
|
+
params: [
|
|
1437
|
+
{ name: 'imageIdentifier', description: 'Portfolio image identifier', type: 'string' },
|
|
1438
|
+
{
|
|
1439
|
+
name: 'altText',
|
|
1440
|
+
description: 'Alt text for the image',
|
|
1441
|
+
type: 'string',
|
|
1442
|
+
optional: true,
|
|
1443
|
+
},
|
|
1444
|
+
],
|
|
1445
|
+
returnType: 'string',
|
|
1446
|
+
example: '%%=Image(@bannerAsset, "Seasonal banner")=%%',
|
|
1447
|
+
},
|
|
1448
|
+
{
|
|
1449
|
+
name: 'IndexOf',
|
|
1450
|
+
syntax: 'IndexOf(haystack, needle)',
|
|
1451
|
+
description: 'Finds the 1-based position of the first occurrence of a substring within a string. Returns 0 if not found.',
|
|
1452
|
+
category: 'String',
|
|
1453
|
+
params: [
|
|
1454
|
+
{ name: 'haystack', description: 'String to search within', type: 'string' },
|
|
1455
|
+
{ name: 'needle', description: 'Substring to find', type: 'string' },
|
|
1456
|
+
],
|
|
1457
|
+
returnType: 'number',
|
|
1458
|
+
example: '%%[\n set @pos = IndexOf("marketing cloud", "cloud")\n /* result: 11 */\n]%%',
|
|
1459
|
+
},
|
|
1460
|
+
{
|
|
1461
|
+
name: 'InsertData',
|
|
1462
|
+
syntax: 'InsertData(dataExtension, column1, value1, column2, value2...)',
|
|
1463
|
+
description: 'Inserts a new row into a Data Extension. Returns 1 on success. Landing pages and CloudPages only.',
|
|
1464
|
+
category: 'Data Extension',
|
|
1465
|
+
params: [
|
|
1466
|
+
{ name: 'dataExtension', description: 'Name of the Data Extension', type: 'string' },
|
|
1467
|
+
{ name: 'column1', description: 'First column name', type: 'string' },
|
|
1468
|
+
{ name: 'value1', description: 'First column value', type: 'string' },
|
|
1469
|
+
{
|
|
1470
|
+
name: 'column2',
|
|
1471
|
+
description: 'Additional column name',
|
|
1472
|
+
type: 'string',
|
|
1473
|
+
optional: true,
|
|
1474
|
+
},
|
|
1475
|
+
{
|
|
1476
|
+
name: 'value2',
|
|
1477
|
+
description: 'Additional column value',
|
|
1478
|
+
type: 'string',
|
|
1479
|
+
optional: true,
|
|
1480
|
+
},
|
|
1481
|
+
],
|
|
1482
|
+
returnType: 'number',
|
|
1483
|
+
example: '%%[\n InsertData("FormSubmissions", "Email", @email, "Timestamp", Now())\n]%%',
|
|
1484
|
+
},
|
|
1485
|
+
{
|
|
1486
|
+
name: 'InsertDE',
|
|
1487
|
+
syntax: 'InsertDE(dataExtension, column1, value1, column2, value2...)',
|
|
1488
|
+
description: 'Inserts a new row into a Data Extension during an email send. No return value.',
|
|
1489
|
+
category: 'Data Extension',
|
|
1490
|
+
params: [
|
|
1491
|
+
{ name: 'dataExtension', description: 'Name of the Data Extension', type: 'string' },
|
|
1492
|
+
{ name: 'column1', description: 'First column name', type: 'string' },
|
|
1493
|
+
{ name: 'value1', description: 'First column value', type: 'string' },
|
|
1494
|
+
{
|
|
1495
|
+
name: 'column2',
|
|
1496
|
+
description: 'Additional column name',
|
|
1497
|
+
type: 'string',
|
|
1498
|
+
optional: true,
|
|
1499
|
+
},
|
|
1500
|
+
{
|
|
1501
|
+
name: 'value2',
|
|
1502
|
+
description: 'Additional column value',
|
|
1503
|
+
type: 'string',
|
|
1504
|
+
optional: true,
|
|
1505
|
+
},
|
|
1506
|
+
],
|
|
1507
|
+
returnType: 'void',
|
|
1508
|
+
example: '%%[\n InsertDE("SendLog", "SubscriberKey", _subscriberKey, "SentDate", Now())\n]%%',
|
|
1509
|
+
},
|
|
1510
|
+
{
|
|
1511
|
+
name: 'InvokeCreate',
|
|
1512
|
+
syntax: 'InvokeCreate(apiObject, statusVar, messageVar, errorCodeVar)',
|
|
1513
|
+
description: 'Executes a Create operation on a Marketing Cloud API object. Returns status, message and error code.',
|
|
1514
|
+
category: 'Marketing Cloud API',
|
|
1515
|
+
params: [
|
|
1516
|
+
{ name: 'apiObject', description: 'API object to create', type: 'object' },
|
|
1517
|
+
{ name: 'statusVar', description: 'Variable for status code', type: 'string' },
|
|
1518
|
+
{ name: 'messageVar', description: 'Variable for status message', type: 'string' },
|
|
1519
|
+
{ name: 'errorCodeVar', description: 'Variable for error code', type: 'string' },
|
|
1520
|
+
],
|
|
1521
|
+
returnType: 'string',
|
|
1522
|
+
example: '%%[\n set @stat = InvokeCreate(@deObj, @status, @msg, @errCode)\n]%%',
|
|
1523
|
+
},
|
|
1524
|
+
{
|
|
1525
|
+
name: 'InvokeDelete',
|
|
1526
|
+
syntax: 'InvokeDelete(apiObject, statusVar, messageVar, errorCodeVar)',
|
|
1527
|
+
description: 'Executes a Delete operation on a Marketing Cloud API object.',
|
|
1528
|
+
category: 'Marketing Cloud API',
|
|
1529
|
+
params: [
|
|
1530
|
+
{ name: 'apiObject', description: 'API object to delete', type: 'object' },
|
|
1531
|
+
{ name: 'statusVar', description: 'Variable for status code', type: 'string' },
|
|
1532
|
+
{ name: 'messageVar', description: 'Variable for status message', type: 'string' },
|
|
1533
|
+
{ name: 'errorCodeVar', description: 'Variable for error code', type: 'string' },
|
|
1534
|
+
],
|
|
1535
|
+
returnType: 'string',
|
|
1536
|
+
example: '%%[\n set @stat = InvokeDelete(@deObj, @status, @msg, @errCode)\n]%%',
|
|
1537
|
+
},
|
|
1538
|
+
{
|
|
1539
|
+
name: 'InvokeExecute',
|
|
1540
|
+
syntax: 'InvokeExecute(apiObject, statusVar, requestIdVar)',
|
|
1541
|
+
description: 'Executes an Execute operation on a Marketing Cloud API object.',
|
|
1542
|
+
category: 'Marketing Cloud API',
|
|
1543
|
+
params: [
|
|
1544
|
+
{ name: 'apiObject', description: 'API object to execute', type: 'object' },
|
|
1545
|
+
{ name: 'statusVar', description: 'Variable for status', type: 'string' },
|
|
1546
|
+
{ name: 'requestIdVar', description: 'Variable for the Request ID', type: 'string' },
|
|
1547
|
+
],
|
|
1548
|
+
returnType: 'string',
|
|
1549
|
+
example: '%%[\n set @stat = InvokeExecute(@importDef, @status, @reqId)\n]%%',
|
|
1550
|
+
},
|
|
1551
|
+
{
|
|
1552
|
+
name: 'InvokePerform',
|
|
1553
|
+
syntax: 'InvokePerform(apiObject, action, statusVar)',
|
|
1554
|
+
description: 'Performs a named action on a Marketing Cloud API object (e.g. "start").',
|
|
1555
|
+
category: 'Marketing Cloud API',
|
|
1556
|
+
params: [
|
|
1557
|
+
{ name: 'apiObject', description: 'API object to perform on', type: 'object' },
|
|
1558
|
+
{ name: 'action', description: 'Action name (e.g. "start", "stop")', type: 'string' },
|
|
1559
|
+
{ name: 'statusVar', description: 'Variable for status message', type: 'string' },
|
|
1560
|
+
],
|
|
1561
|
+
returnType: 'string',
|
|
1562
|
+
example: '%%[\n set @stat = InvokePerform(@ts, "start", @msg)\n]%%',
|
|
1563
|
+
},
|
|
1564
|
+
{
|
|
1565
|
+
name: 'InvokeRetrieve',
|
|
1566
|
+
syntax: 'InvokeRetrieve(retrieveRequest, statusVar, requestIdVar)',
|
|
1567
|
+
description: 'Executes a Retrieve operation on a Marketing Cloud API RetrieveRequest object.',
|
|
1568
|
+
category: 'Marketing Cloud API',
|
|
1569
|
+
params: [
|
|
1570
|
+
{ name: 'retrieveRequest', description: 'RetrieveRequest API object', type: 'object' },
|
|
1571
|
+
{ name: 'statusVar', description: 'Variable for status message', type: 'string' },
|
|
1572
|
+
{ name: 'requestIdVar', description: 'Variable for the Request ID', type: 'string' },
|
|
1573
|
+
],
|
|
1574
|
+
returnType: 'rowset',
|
|
1575
|
+
example: '%%[\n set @rows = InvokeRetrieve(@rr, @status, @reqId)\n]%%',
|
|
1576
|
+
},
|
|
1577
|
+
{
|
|
1578
|
+
name: 'InvokeUpdate',
|
|
1579
|
+
syntax: 'InvokeUpdate(apiObject, statusVar, messageVar, errorCodeVar)',
|
|
1580
|
+
description: 'Executes an Update operation on a Marketing Cloud API object.',
|
|
1581
|
+
category: 'Marketing Cloud API',
|
|
1582
|
+
params: [
|
|
1583
|
+
{ name: 'apiObject', description: 'API object to update', type: 'object' },
|
|
1584
|
+
{ name: 'statusVar', description: 'Variable for status code', type: 'string' },
|
|
1585
|
+
{ name: 'messageVar', description: 'Variable for status message', type: 'string' },
|
|
1586
|
+
{ name: 'errorCodeVar', description: 'Variable for error code', type: 'string' },
|
|
1587
|
+
],
|
|
1588
|
+
returnType: 'string',
|
|
1589
|
+
example: '%%[\n set @stat = InvokeUpdate(@deObj, @status, @msg, @errCode)\n]%%',
|
|
1590
|
+
},
|
|
1591
|
+
{
|
|
1592
|
+
name: 'IsCHTMLBrowser',
|
|
1593
|
+
syntax: 'IsCHTMLBrowser(userAgent)',
|
|
1594
|
+
description: 'Checks if a user-agent string indicates a C-HTML (compact HTML) browser. Landing pages only.',
|
|
1595
|
+
category: 'Utility',
|
|
1596
|
+
params: [
|
|
1597
|
+
{
|
|
1598
|
+
name: 'userAgent',
|
|
1599
|
+
description: 'User-Agent header value to evaluate',
|
|
1600
|
+
type: 'string',
|
|
1601
|
+
},
|
|
1602
|
+
],
|
|
1603
|
+
returnType: 'boolean',
|
|
1604
|
+
example: '%%[\n set @isCHTML = IsCHTMLBrowser(HTTPRequestHeader("User-Agent"))\n]%%',
|
|
1605
|
+
},
|
|
1606
|
+
{
|
|
1607
|
+
name: 'IsEmailAddress',
|
|
1608
|
+
syntax: 'IsEmailAddress(value)',
|
|
1609
|
+
description: 'Validates whether a string conforms to standard email address syntax.',
|
|
1610
|
+
category: 'Utility',
|
|
1611
|
+
params: [{ name: 'value', description: 'String to validate', type: 'string' }],
|
|
1612
|
+
returnType: 'boolean',
|
|
1613
|
+
example: '%%[\n if IsEmailAddress(@inputEmail) then\n /* process valid email */\n endif\n]%%',
|
|
1614
|
+
},
|
|
1615
|
+
{
|
|
1616
|
+
name: 'IsNull',
|
|
1617
|
+
syntax: 'IsNull(expression)',
|
|
1618
|
+
description: 'Tests whether a value is null (but not empty string). Returns true if null, false otherwise.',
|
|
1619
|
+
category: 'Utility',
|
|
1620
|
+
params: [
|
|
1621
|
+
{ name: 'expression', description: 'Value or expression to test', type: 'string' },
|
|
1622
|
+
],
|
|
1623
|
+
returnType: 'boolean',
|
|
1624
|
+
example: '%%[\n if IsNull(@optIn) then\n set @optIn = false\n endif\n]%%',
|
|
1625
|
+
},
|
|
1626
|
+
{
|
|
1627
|
+
name: 'IsNullDefault',
|
|
1628
|
+
syntax: 'IsNullDefault(expression, defaultValue)',
|
|
1629
|
+
description: 'Returns the expression value if it is not empty; otherwise returns the specified default.',
|
|
1630
|
+
category: 'Utility',
|
|
1631
|
+
params: [
|
|
1632
|
+
{ name: 'expression', description: 'Value to test', type: 'string' },
|
|
1633
|
+
{
|
|
1634
|
+
name: 'defaultValue',
|
|
1635
|
+
description: 'Fallback value if expression is null/empty',
|
|
1636
|
+
type: 'string',
|
|
1637
|
+
},
|
|
1638
|
+
],
|
|
1639
|
+
returnType: 'string',
|
|
1640
|
+
example: '%%[\n set @city = IsNullDefault(@inputCity, "Unknown")\n]%%',
|
|
1641
|
+
},
|
|
1642
|
+
{
|
|
1643
|
+
name: 'IsPhoneNumber',
|
|
1644
|
+
syntax: 'IsPhoneNumber(value)',
|
|
1645
|
+
description: 'Checks whether a string matches a valid US phone number format.',
|
|
1646
|
+
category: 'Utility',
|
|
1647
|
+
params: [{ name: 'value', description: 'String to validate', type: 'string' }],
|
|
1648
|
+
returnType: 'boolean',
|
|
1649
|
+
example: '%%[\n if IsPhoneNumber(@phone) then\n /* process phone */\n endif\n]%%',
|
|
1650
|
+
},
|
|
1651
|
+
{
|
|
1652
|
+
name: 'Length',
|
|
1653
|
+
syntax: 'Length(inputString)',
|
|
1654
|
+
description: 'Returns the number of characters in a string.',
|
|
1655
|
+
category: 'String',
|
|
1656
|
+
params: [{ name: 'inputString', description: 'The string to measure', type: 'string' }],
|
|
1657
|
+
returnType: 'number',
|
|
1658
|
+
example: '%%[\n set @len = Length("Hello World")\n /* result: 11 */\n]%%',
|
|
1659
|
+
},
|
|
1660
|
+
{
|
|
1661
|
+
name: 'LiveContentMicrositeURL',
|
|
1662
|
+
syntax: 'LiveContentMicrositeURL(pageId, liveContentId)',
|
|
1663
|
+
description: 'Generates a URL for displaying Live Content offers on a microsite page.',
|
|
1664
|
+
category: 'Content',
|
|
1665
|
+
params: [
|
|
1666
|
+
{ name: 'pageId', description: 'Microsite page ID', type: 'string' },
|
|
1667
|
+
{ name: 'liveContentId', description: 'Live Content asset ID', type: 'string' },
|
|
1668
|
+
],
|
|
1669
|
+
returnType: 'string',
|
|
1670
|
+
example: '%%=LiveContentMicrositeURL(101, 202)=%%',
|
|
1671
|
+
},
|
|
1672
|
+
{
|
|
1673
|
+
name: 'LocalDateToSystemDate',
|
|
1674
|
+
syntax: 'LocalDateToSystemDate(localDate)',
|
|
1675
|
+
description: 'Converts a local date/time to the Marketing Cloud system time zone (Central Standard Time).',
|
|
1676
|
+
category: 'Date and Time',
|
|
1677
|
+
params: [{ name: 'localDate', description: 'Local date value to convert', type: 'date' }],
|
|
1678
|
+
returnType: 'date',
|
|
1679
|
+
example: '%%[\n set @cstDate = LocalDateToSystemDate(@localTimestamp)\n]%%',
|
|
1680
|
+
},
|
|
1681
|
+
{
|
|
1682
|
+
name: 'LongSFID',
|
|
1683
|
+
syntax: 'LongSFID(sfid15)',
|
|
1684
|
+
description: 'Converts a 15-character case-sensitive Salesforce ID to its 18-character case-insensitive equivalent.',
|
|
1685
|
+
category: 'Sales and Service Cloud',
|
|
1686
|
+
params: [
|
|
1687
|
+
{ name: 'sfid15', description: '15-character Salesforce record ID', type: 'string' },
|
|
1688
|
+
],
|
|
1689
|
+
returnType: 'string',
|
|
1690
|
+
example: '%%[\n set @sfid18 = LongSFID(@shortId)\n]%%',
|
|
1691
|
+
},
|
|
1692
|
+
{
|
|
1693
|
+
name: 'Lookup',
|
|
1694
|
+
syntax: 'Lookup(dataExtension, returnColumn, searchColumn, searchValue, searchColumn2, searchValue2...)',
|
|
1695
|
+
description: 'Returns a single column value from the first matching row in a Data Extension.',
|
|
1696
|
+
category: 'Data Extension',
|
|
1697
|
+
params: [
|
|
1698
|
+
{ name: 'dataExtension', description: 'Name of the Data Extension', type: 'string' },
|
|
1699
|
+
{
|
|
1700
|
+
name: 'returnColumn',
|
|
1701
|
+
description: 'Column to return the value from',
|
|
1702
|
+
type: 'string',
|
|
1703
|
+
},
|
|
1704
|
+
{ name: 'searchColumn', description: 'Column to match on', type: 'string' },
|
|
1705
|
+
{ name: 'searchValue', description: 'Value to match', type: 'string' },
|
|
1706
|
+
{
|
|
1707
|
+
name: 'searchColumn2',
|
|
1708
|
+
description: 'Additional search column',
|
|
1709
|
+
type: 'string',
|
|
1710
|
+
optional: true,
|
|
1711
|
+
},
|
|
1712
|
+
{
|
|
1713
|
+
name: 'searchValue2',
|
|
1714
|
+
description: 'Additional search value',
|
|
1715
|
+
type: 'string',
|
|
1716
|
+
optional: true,
|
|
1717
|
+
},
|
|
1718
|
+
],
|
|
1719
|
+
returnType: 'string',
|
|
1720
|
+
example: '%%[\n set @region = Lookup("MemberDirectory", "Territory", "MemberId", @memberId)\n]%%',
|
|
1721
|
+
},
|
|
1722
|
+
{
|
|
1723
|
+
name: 'LookupOrderedRows',
|
|
1724
|
+
syntax: 'LookupOrderedRows(dataExtension, maxRows, sortColumn, searchColumn, searchValue...)',
|
|
1725
|
+
description: 'Returns a sorted set of rows from a Data Extension, limited to a maximum count.',
|
|
1726
|
+
category: 'Data Extension',
|
|
1727
|
+
params: [
|
|
1728
|
+
{ name: 'dataExtension', description: 'Name of the Data Extension', type: 'string' },
|
|
1729
|
+
{ name: 'maxRows', description: 'Maximum rows to return', type: 'number' },
|
|
1730
|
+
{
|
|
1731
|
+
name: 'sortColumn',
|
|
1732
|
+
description: 'Column and direction (e.g. "CreatedDate DESC")',
|
|
1733
|
+
type: 'string',
|
|
1734
|
+
},
|
|
1735
|
+
{ name: 'searchColumn', description: 'Column to filter on', type: 'string' },
|
|
1736
|
+
{ name: 'searchValue', description: 'Value to match', type: 'string' },
|
|
1737
|
+
],
|
|
1738
|
+
returnType: 'rowset',
|
|
1739
|
+
example: '%%[\n set @orders = LookupOrderedRows("Orders", 5, "OrderDate DESC", "CustomerId", @custId)\n]%%',
|
|
1740
|
+
},
|
|
1741
|
+
{
|
|
1742
|
+
name: 'LookupOrderedRowsCS',
|
|
1743
|
+
syntax: 'LookupOrderedRowsCS(dataExtension, maxRows, sortColumn, searchColumn, searchValue...)',
|
|
1744
|
+
description: 'Case-sensitive version of LookupOrderedRows.',
|
|
1745
|
+
category: 'Data Extension',
|
|
1746
|
+
params: [
|
|
1747
|
+
{ name: 'dataExtension', description: 'Name of the Data Extension', type: 'string' },
|
|
1748
|
+
{ name: 'maxRows', description: 'Maximum rows to return', type: 'number' },
|
|
1749
|
+
{ name: 'sortColumn', description: 'Column and direction', type: 'string' },
|
|
1750
|
+
{ name: 'searchColumn', description: 'Column to filter on', type: 'string' },
|
|
1751
|
+
{ name: 'searchValue', description: 'Value to match (case-sensitive)', type: 'string' },
|
|
1752
|
+
],
|
|
1753
|
+
returnType: 'rowset',
|
|
1754
|
+
example: '%%[\n set @matches = LookupOrderedRowsCS("Products", 10, "Name ASC", "SKU", @sku)\n]%%',
|
|
1755
|
+
},
|
|
1756
|
+
{
|
|
1757
|
+
name: 'LookupRows',
|
|
1758
|
+
syntax: 'LookupRows(dataExtension, searchColumn, searchValue, searchColumn2, searchValue2...)',
|
|
1759
|
+
description: 'Returns all matching rows from a Data Extension as an unordered row set.',
|
|
1760
|
+
category: 'Data Extension',
|
|
1761
|
+
params: [
|
|
1762
|
+
{ name: 'dataExtension', description: 'Name of the Data Extension', type: 'string' },
|
|
1763
|
+
{ name: 'searchColumn', description: 'Column to match on', type: 'string' },
|
|
1764
|
+
{ name: 'searchValue', description: 'Value to match', type: 'string' },
|
|
1765
|
+
{
|
|
1766
|
+
name: 'searchColumn2',
|
|
1767
|
+
description: 'Additional search column',
|
|
1768
|
+
type: 'string',
|
|
1769
|
+
optional: true,
|
|
1770
|
+
},
|
|
1771
|
+
{
|
|
1772
|
+
name: 'searchValue2',
|
|
1773
|
+
description: 'Additional search value',
|
|
1774
|
+
type: 'string',
|
|
1775
|
+
optional: true,
|
|
1776
|
+
},
|
|
1777
|
+
],
|
|
1778
|
+
returnType: 'rowset',
|
|
1779
|
+
example: '%%[\n set @rows = LookupRows("Preferences", "SubscriberKey", _subscriberKey)\n]%%',
|
|
1780
|
+
},
|
|
1781
|
+
{
|
|
1782
|
+
name: 'LookupRowsCS',
|
|
1783
|
+
syntax: 'LookupRowsCS(dataExtension, searchColumn, searchValue, searchColumn2, searchValue2...)',
|
|
1784
|
+
description: 'Case-sensitive version of LookupRows.',
|
|
1785
|
+
category: 'Data Extension',
|
|
1786
|
+
params: [
|
|
1787
|
+
{ name: 'dataExtension', description: 'Name of the Data Extension', type: 'string' },
|
|
1788
|
+
{ name: 'searchColumn', description: 'Column to match on', type: 'string' },
|
|
1789
|
+
{ name: 'searchValue', description: 'Value to match (case-sensitive)', type: 'string' },
|
|
1790
|
+
{
|
|
1791
|
+
name: 'searchColumn2',
|
|
1792
|
+
description: 'Additional search column',
|
|
1793
|
+
type: 'string',
|
|
1794
|
+
optional: true,
|
|
1795
|
+
},
|
|
1796
|
+
{
|
|
1797
|
+
name: 'searchValue2',
|
|
1798
|
+
description: 'Additional search value',
|
|
1799
|
+
type: 'string',
|
|
1800
|
+
optional: true,
|
|
1801
|
+
},
|
|
1802
|
+
],
|
|
1803
|
+
returnType: 'rowset',
|
|
1804
|
+
example: '%%[\n set @exact = LookupRowsCS("Tags", "Label", "VIP")\n]%%',
|
|
1805
|
+
},
|
|
1806
|
+
{
|
|
1807
|
+
name: 'Lowercase',
|
|
1808
|
+
syntax: 'Lowercase(inputString)',
|
|
1809
|
+
description: 'Converts every uppercase character in a string to lowercase.',
|
|
1810
|
+
category: 'String',
|
|
1811
|
+
params: [{ name: 'inputString', description: 'String to convert', type: 'string' }],
|
|
1812
|
+
returnType: 'string',
|
|
1813
|
+
example: '%%[\n set @lower = Lowercase("HELLO")\n /* result: "hello" */\n]%%',
|
|
1814
|
+
},
|
|
1815
|
+
{
|
|
1816
|
+
name: 'MD5',
|
|
1817
|
+
syntax: 'MD5(inputString, encoding)',
|
|
1818
|
+
description: 'Produces a 32-character hexadecimal MD5 hash of the input string.',
|
|
1819
|
+
category: 'Encryption and Encoding',
|
|
1820
|
+
params: [
|
|
1821
|
+
{ name: 'inputString', description: 'String to hash', type: 'string' },
|
|
1822
|
+
{ name: 'encoding', description: 'Character encoding', type: 'string', optional: true },
|
|
1823
|
+
],
|
|
1824
|
+
returnType: 'string',
|
|
1825
|
+
example: '%%[\n set @hash = MD5(@emailAddr)\n]%%',
|
|
1826
|
+
},
|
|
1827
|
+
{
|
|
1828
|
+
name: 'MicrositeURL',
|
|
1829
|
+
syntax: 'MicrositeURL(pageID, param1Name, param1Value...)',
|
|
1830
|
+
description: 'Builds an encrypted URL to a Classic microsite page with optional name/value parameters.',
|
|
1831
|
+
category: 'Utility',
|
|
1832
|
+
params: [
|
|
1833
|
+
{ name: 'pageID', description: 'Numeric microsite page ID', type: 'number' },
|
|
1834
|
+
{
|
|
1835
|
+
name: 'param1Name',
|
|
1836
|
+
description: 'First query parameter name',
|
|
1837
|
+
type: 'string',
|
|
1838
|
+
optional: true,
|
|
1839
|
+
},
|
|
1840
|
+
{
|
|
1841
|
+
name: 'param1Value',
|
|
1842
|
+
description: 'First query parameter value',
|
|
1843
|
+
type: 'string',
|
|
1844
|
+
optional: true,
|
|
1845
|
+
},
|
|
1846
|
+
],
|
|
1847
|
+
returnType: 'string',
|
|
1848
|
+
example: '%%[\n set @link = MicrositeURL(55, "ref", @campaignId)\n]%%',
|
|
1849
|
+
},
|
|
1850
|
+
{
|
|
1851
|
+
name: 'Mod',
|
|
1852
|
+
syntax: 'Mod(dividend, divisor)',
|
|
1853
|
+
description: 'Returns the remainder of dividing the first number by the second (modulo operation).',
|
|
1854
|
+
category: 'Math',
|
|
1855
|
+
params: [
|
|
1856
|
+
{ name: 'dividend', description: 'The number to divide', type: 'number' },
|
|
1857
|
+
{ name: 'divisor', description: 'The divisor', type: 'number' },
|
|
1858
|
+
],
|
|
1859
|
+
returnType: 'number',
|
|
1860
|
+
example: '%%[\n set @isEven = IIf(Mod(@index, 2) == 0, "even", "odd")\n]%%',
|
|
1861
|
+
},
|
|
1862
|
+
{
|
|
1863
|
+
name: 'Multiply',
|
|
1864
|
+
syntax: 'Multiply(factor1, factor2)',
|
|
1865
|
+
description: 'Multiplies two numbers and returns the product.',
|
|
1866
|
+
category: 'Math',
|
|
1867
|
+
params: [
|
|
1868
|
+
{ name: 'factor1', description: 'First factor', type: 'number' },
|
|
1869
|
+
{ name: 'factor2', description: 'Second factor', type: 'number' },
|
|
1870
|
+
],
|
|
1871
|
+
returnType: 'number',
|
|
1872
|
+
example: '%%[\n set @lineTotal = Multiply(@unitPrice, @quantity)\n]%%',
|
|
1873
|
+
},
|
|
1874
|
+
{
|
|
1875
|
+
name: 'Now',
|
|
1876
|
+
syntax: 'Now(preserveSendTime)',
|
|
1877
|
+
description: 'Returns the current system date/time in Central Standard Time. Optionally preserves the original send time.',
|
|
1878
|
+
category: 'Date and Time',
|
|
1879
|
+
params: [
|
|
1880
|
+
{
|
|
1881
|
+
name: 'preserveSendTime',
|
|
1882
|
+
description: 'If true, returns the date/time of the initial send rather than current time',
|
|
1883
|
+
type: 'boolean',
|
|
1884
|
+
optional: true,
|
|
1885
|
+
},
|
|
1886
|
+
],
|
|
1887
|
+
returnType: 'date',
|
|
1888
|
+
example: '%%[\n set @today = Now()\n]%%',
|
|
1889
|
+
},
|
|
1890
|
+
{
|
|
1891
|
+
name: 'Output',
|
|
1892
|
+
syntax: 'Output(content)',
|
|
1893
|
+
description: "Writes a value to the rendered output at the script block's position. Commonly used for debugging.",
|
|
1894
|
+
category: 'Utility',
|
|
1895
|
+
params: [{ name: 'content', description: 'Value or expression to output', type: 'string' }],
|
|
1896
|
+
returnType: 'void',
|
|
1897
|
+
example: '%%[\n Output(Concat("Debug: @userId = ", @userId))\n]%%',
|
|
1898
|
+
},
|
|
1899
|
+
{
|
|
1900
|
+
name: 'OutputLine',
|
|
1901
|
+
syntax: 'OutputLine(content)',
|
|
1902
|
+
description: 'Same as Output but appends a line feed character after the rendered value.',
|
|
1903
|
+
category: 'Utility',
|
|
1904
|
+
params: [{ name: 'content', description: 'Value or expression to output', type: 'string' }],
|
|
1905
|
+
returnType: 'void',
|
|
1906
|
+
example: '%%[\n OutputLine(Concat("Row ", @i, ": ", @val))\n]%%',
|
|
1907
|
+
},
|
|
1908
|
+
{
|
|
1909
|
+
name: 'ProperCase',
|
|
1910
|
+
syntax: 'ProperCase(inputString)',
|
|
1911
|
+
description: 'Capitalizes the first letter of each word and lowercases all other characters.',
|
|
1912
|
+
category: 'String',
|
|
1913
|
+
params: [{ name: 'inputString', description: 'String to convert', type: 'string' }],
|
|
1914
|
+
returnType: 'string',
|
|
1915
|
+
example: '%%[\n set @name = ProperCase("jane doe")\n /* result: "Jane Doe" */\n]%%',
|
|
1916
|
+
},
|
|
1917
|
+
{
|
|
1918
|
+
name: 'QueryParameter',
|
|
1919
|
+
syntax: 'QueryParameter(parameterName)',
|
|
1920
|
+
description: "Extracts a named value from the current page URL's query string.",
|
|
1921
|
+
category: 'Utility',
|
|
1922
|
+
params: [
|
|
1923
|
+
{
|
|
1924
|
+
name: 'parameterName',
|
|
1925
|
+
description: 'The query string parameter key',
|
|
1926
|
+
type: 'string',
|
|
1927
|
+
},
|
|
1928
|
+
],
|
|
1929
|
+
returnType: 'string',
|
|
1930
|
+
example: '%%[\n set @campaign = QueryParameter("utm_campaign")\n]%%',
|
|
1931
|
+
},
|
|
1932
|
+
{
|
|
1933
|
+
name: 'RaiseError',
|
|
1934
|
+
syntax: 'RaiseError(message, skipSend, apiError, errorCode, isTransient)',
|
|
1935
|
+
description: 'Halts processing and optionally suppresses or cancels an email send for the current subscriber. Useful for exception handling.',
|
|
1936
|
+
category: 'Utility',
|
|
1937
|
+
params: [
|
|
1938
|
+
{ name: 'message', description: 'Error message text', type: 'string' },
|
|
1939
|
+
{
|
|
1940
|
+
name: 'skipSend',
|
|
1941
|
+
description: 'Whether to skip the send for this subscriber',
|
|
1942
|
+
type: 'boolean',
|
|
1943
|
+
optional: true,
|
|
1944
|
+
},
|
|
1945
|
+
{
|
|
1946
|
+
name: 'apiError',
|
|
1947
|
+
description: 'Whether this is an API-facing error',
|
|
1948
|
+
type: 'boolean',
|
|
1949
|
+
optional: true,
|
|
1950
|
+
},
|
|
1951
|
+
{
|
|
1952
|
+
name: 'errorCode',
|
|
1953
|
+
description: 'Numeric error code',
|
|
1954
|
+
type: 'number',
|
|
1955
|
+
optional: true,
|
|
1956
|
+
},
|
|
1957
|
+
{
|
|
1958
|
+
name: 'isTransient',
|
|
1959
|
+
description: 'Whether the error is transient/retryable',
|
|
1960
|
+
type: 'boolean',
|
|
1961
|
+
optional: true,
|
|
1962
|
+
},
|
|
1963
|
+
],
|
|
1964
|
+
returnType: 'void',
|
|
1965
|
+
example: '%%[\n if Empty(@requiredField) then\n RaiseError("Missing required data", true)\n endif\n]%%',
|
|
1966
|
+
},
|
|
1967
|
+
{
|
|
1968
|
+
name: 'Random',
|
|
1969
|
+
syntax: 'Random(lowerBound, upperBound)',
|
|
1970
|
+
description: 'Generates a random integer between the lower and upper bounds (inclusive).',
|
|
1971
|
+
category: 'Math',
|
|
1972
|
+
params: [
|
|
1973
|
+
{ name: 'lowerBound', description: 'Minimum value (inclusive)', type: 'number' },
|
|
1974
|
+
{ name: 'upperBound', description: 'Maximum value (inclusive)', type: 'number' },
|
|
1975
|
+
],
|
|
1976
|
+
returnType: 'number',
|
|
1977
|
+
example: '%%[\n set @dice = Random(1, 6)\n]%%',
|
|
1978
|
+
},
|
|
1979
|
+
{
|
|
1980
|
+
name: 'RatingStars',
|
|
1981
|
+
syntax: 'RatingStars(rating, maxStars, imageUrl)',
|
|
1982
|
+
description: 'Renders a star-rating image for Einstein Email Recommendations based on a product rating.',
|
|
1983
|
+
category: 'Einstein Email Recommendations',
|
|
1984
|
+
params: [
|
|
1985
|
+
{ name: 'rating', description: 'Numeric rating value', type: 'number' },
|
|
1986
|
+
{ name: 'maxStars', description: 'Maximum number of stars', type: 'number' },
|
|
1987
|
+
{ name: 'imageUrl', description: 'URL template for star images', type: 'string' },
|
|
1988
|
+
],
|
|
1989
|
+
returnType: 'string',
|
|
1990
|
+
example: '%%=RatingStars(@productRating, 5, @starImgUrl)=%%',
|
|
1991
|
+
},
|
|
1992
|
+
{
|
|
1993
|
+
name: 'Redirect',
|
|
1994
|
+
syntax: 'Redirect(url)',
|
|
1995
|
+
description: 'Immediately redirects the visitor to the specified URL. Landing pages only.',
|
|
1996
|
+
category: 'Utility',
|
|
1997
|
+
params: [{ name: 'url', description: 'Destination URL', type: 'string' }],
|
|
1998
|
+
returnType: 'void',
|
|
1999
|
+
example: '%%[\n Redirect("https://www.example.com/thank-you")\n]%%',
|
|
2000
|
+
},
|
|
2001
|
+
{
|
|
2002
|
+
name: 'RedirectTo',
|
|
2003
|
+
syntax: 'RedirectTo(url)',
|
|
2004
|
+
description: 'Wraps a dynamic URL for use as a tracked hyperlink in emails. Required when the href is a variable or expression.',
|
|
2005
|
+
category: 'Utility',
|
|
2006
|
+
params: [
|
|
2007
|
+
{ name: 'url', description: 'URL value (variable or expression)', type: 'string' },
|
|
2008
|
+
],
|
|
2009
|
+
returnType: 'string',
|
|
2010
|
+
example: '<a href="%%=RedirectTo(@profileUrl)=%%">View Profile</a>',
|
|
2011
|
+
},
|
|
2012
|
+
{
|
|
2013
|
+
name: 'RegExMatch',
|
|
2014
|
+
syntax: 'RegExMatch(inputString, pattern, matchGroup, additionalGroups...)',
|
|
2015
|
+
description: 'Applies a regular expression to a string and returns the first match (or a specific capture group).',
|
|
2016
|
+
category: 'String',
|
|
2017
|
+
params: [
|
|
2018
|
+
{ name: 'inputString', description: 'String to search', type: 'string' },
|
|
2019
|
+
{ name: 'pattern', description: 'Regular expression pattern', type: 'string' },
|
|
2020
|
+
{
|
|
2021
|
+
name: 'matchGroup',
|
|
2022
|
+
description: 'Variable to hold match/group value',
|
|
2023
|
+
type: 'string',
|
|
2024
|
+
},
|
|
2025
|
+
{
|
|
2026
|
+
name: 'additionalGroups',
|
|
2027
|
+
description: 'Additional capture group variables',
|
|
2028
|
+
type: 'string',
|
|
2029
|
+
optional: true,
|
|
2030
|
+
},
|
|
2031
|
+
],
|
|
2032
|
+
returnType: 'string',
|
|
2033
|
+
example: '%%[\n set @match = RegExMatch(@input, "^(\\\\d{3})-(\\\\d{4})$", @full, @area, @num)\n]%%',
|
|
2034
|
+
},
|
|
2035
|
+
{
|
|
2036
|
+
name: 'Replace',
|
|
2037
|
+
syntax: 'Replace(inputString, searchString, replacementString)',
|
|
2038
|
+
description: 'Replaces all occurrences of a search string within the input with the replacement string.',
|
|
2039
|
+
category: 'String',
|
|
2040
|
+
params: [
|
|
2041
|
+
{ name: 'inputString', description: 'Original string', type: 'string' },
|
|
2042
|
+
{ name: 'searchString', description: 'Substring to find', type: 'string' },
|
|
2043
|
+
{ name: 'replacementString', description: 'Replacement text', type: 'string' },
|
|
2044
|
+
],
|
|
2045
|
+
returnType: 'string',
|
|
2046
|
+
example: '%%[\n set @clean = Replace(@rawText, "&", "&")\n]%%',
|
|
2047
|
+
},
|
|
2048
|
+
{
|
|
2049
|
+
name: 'ReplaceList',
|
|
2050
|
+
syntax: 'ReplaceList(inputString, searchString, replacement1, replacement2...)',
|
|
2051
|
+
description: 'Replaces the search string with each replacement value in succession across the input.',
|
|
2052
|
+
category: 'String',
|
|
2053
|
+
params: [
|
|
2054
|
+
{
|
|
2055
|
+
name: 'inputString',
|
|
2056
|
+
description: 'Original string containing placeholders',
|
|
2057
|
+
type: 'string',
|
|
2058
|
+
},
|
|
2059
|
+
{
|
|
2060
|
+
name: 'searchString',
|
|
2061
|
+
description: 'Placeholder substring to replace',
|
|
2062
|
+
type: 'string',
|
|
2063
|
+
},
|
|
2064
|
+
{ name: 'replacement1', description: 'First replacement value', type: 'string' },
|
|
2065
|
+
{
|
|
2066
|
+
name: 'replacement2',
|
|
2067
|
+
description: 'Subsequent replacement values',
|
|
2068
|
+
type: 'string',
|
|
2069
|
+
optional: true,
|
|
2070
|
+
},
|
|
2071
|
+
],
|
|
2072
|
+
returnType: 'string',
|
|
2073
|
+
example: '%%[\n set @out = ReplaceList("? and ? and ?", "?", "A", "B", "C")\n /* result: "A and B and C" */\n]%%',
|
|
2074
|
+
},
|
|
2075
|
+
{
|
|
2076
|
+
name: 'RequestParameter',
|
|
2077
|
+
syntax: 'RequestParameter(parameterName)',
|
|
2078
|
+
description: 'Retrieves a value from the URL query string or from a submitted form field.',
|
|
2079
|
+
category: 'Utility',
|
|
2080
|
+
params: [
|
|
2081
|
+
{ name: 'parameterName', description: 'Parameter or form field name', type: 'string' },
|
|
2082
|
+
],
|
|
2083
|
+
returnType: 'string',
|
|
2084
|
+
example: '%%[\n set @submittedEmail = RequestParameter("email")\n]%%',
|
|
2085
|
+
},
|
|
2086
|
+
{
|
|
2087
|
+
name: 'RetrieveMSCRMRecords',
|
|
2088
|
+
syntax: 'RetrieveMSCRMRecords(entityName, columnList, filterColumn, filterOperator, filterValue)',
|
|
2089
|
+
description: 'Queries rows from a Microsoft Dynamics CRM entity.',
|
|
2090
|
+
category: 'Microsoft Dynamics CRM',
|
|
2091
|
+
params: [
|
|
2092
|
+
{ name: 'entityName', description: 'CRM entity logical name', type: 'string' },
|
|
2093
|
+
{
|
|
2094
|
+
name: 'columnList',
|
|
2095
|
+
description: 'Comma-separated list of columns to retrieve',
|
|
2096
|
+
type: 'string',
|
|
2097
|
+
},
|
|
2098
|
+
{ name: 'filterColumn', description: 'Column to filter on', type: 'string' },
|
|
2099
|
+
{ name: 'filterOperator', description: 'Comparison operator', type: 'string' },
|
|
2100
|
+
{ name: 'filterValue', description: 'Value to filter by', type: 'string' },
|
|
2101
|
+
],
|
|
2102
|
+
returnType: 'rowset',
|
|
2103
|
+
example: '%%[\n set @contacts = RetrieveMSCRMRecords("contact", "firstname,email", "statecode", "=", "0")\n]%%',
|
|
2104
|
+
},
|
|
2105
|
+
{
|
|
2106
|
+
name: 'RetrieveMSCRMRecordsFetchXML',
|
|
2107
|
+
syntax: 'RetrieveMSCRMRecordsFetchXML(fetchXml)',
|
|
2108
|
+
description: 'Queries a Dynamics CRM org using a raw FetchXML query string.',
|
|
2109
|
+
category: 'Microsoft Dynamics CRM',
|
|
2110
|
+
params: [{ name: 'fetchXml', description: 'FetchXML query string', type: 'string' }],
|
|
2111
|
+
returnType: 'rowset',
|
|
2112
|
+
example: '%%[\n set @data = RetrieveMSCRMRecordsFetchXML(@fetchQuery)\n]%%',
|
|
2113
|
+
},
|
|
2114
|
+
{
|
|
2115
|
+
name: 'RetrieveSalesforceJobSources',
|
|
2116
|
+
syntax: 'RetrieveSalesforceJobSources(jobId)',
|
|
2117
|
+
description: 'Returns details about the audience sources for a Salesforce-triggered send job.',
|
|
2118
|
+
category: 'Sales and Service Cloud',
|
|
2119
|
+
params: [{ name: 'jobId', description: 'Job identifier', type: 'number' }],
|
|
2120
|
+
returnType: 'rowset',
|
|
2121
|
+
example: '%%[\n set @sources = RetrieveSalesforceJobSources(@jobId)\n]%%',
|
|
2122
|
+
},
|
|
2123
|
+
{
|
|
2124
|
+
name: 'RetrieveSalesforceObjects',
|
|
2125
|
+
syntax: 'RetrieveSalesforceObjects(objectName, fieldList, filterField, operator, filterValue, additionalFilters...)',
|
|
2126
|
+
description: 'Queries records from a Salesforce standard or custom object and returns them as a row set.',
|
|
2127
|
+
category: 'Sales and Service Cloud',
|
|
2128
|
+
params: [
|
|
2129
|
+
{ name: 'objectName', description: 'Salesforce object API name', type: 'string' },
|
|
2130
|
+
{
|
|
2131
|
+
name: 'fieldList',
|
|
2132
|
+
description: 'Comma-separated field names to retrieve',
|
|
2133
|
+
type: 'string',
|
|
2134
|
+
},
|
|
2135
|
+
{ name: 'filterField', description: 'Field to filter on', type: 'string' },
|
|
2136
|
+
{
|
|
2137
|
+
name: 'operator',
|
|
2138
|
+
description: 'Comparison operator (e.g. "=", ">")',
|
|
2139
|
+
type: 'string',
|
|
2140
|
+
},
|
|
2141
|
+
{ name: 'filterValue', description: 'Value to compare against', type: 'string' },
|
|
2142
|
+
{
|
|
2143
|
+
name: 'additionalFilters',
|
|
2144
|
+
description: 'Additional filter triplets',
|
|
2145
|
+
type: 'string',
|
|
2146
|
+
optional: true,
|
|
2147
|
+
},
|
|
2148
|
+
],
|
|
2149
|
+
returnType: 'rowset',
|
|
2150
|
+
example: '%%[\n set @opps = RetrieveSalesforceObjects("Opportunity", "Id,Name", "StageName", "=", "Closed Won")\n]%%',
|
|
2151
|
+
},
|
|
2152
|
+
{
|
|
2153
|
+
name: 'Row',
|
|
2154
|
+
syntax: 'Row(rowSet, index)',
|
|
2155
|
+
description: 'Extracts a single row from a row set by its 1-based index.',
|
|
2156
|
+
category: 'Data Extension',
|
|
2157
|
+
params: [
|
|
2158
|
+
{ name: 'rowSet', description: 'Row set to read from', type: 'rowset' },
|
|
2159
|
+
{ name: 'index', description: '1-based row index', type: 'number' },
|
|
2160
|
+
],
|
|
2161
|
+
returnType: 'row',
|
|
2162
|
+
example: '%%[\n set @firstRow = Row(@results, 1)\n]%%',
|
|
2163
|
+
},
|
|
2164
|
+
{
|
|
2165
|
+
name: 'RowCount',
|
|
2166
|
+
syntax: 'RowCount(rowSet)',
|
|
2167
|
+
description: 'Returns the number of rows in a row set.',
|
|
2168
|
+
category: 'Data Extension',
|
|
2169
|
+
params: [{ name: 'rowSet', description: 'Row set to count', type: 'rowset' }],
|
|
2170
|
+
returnType: 'number',
|
|
2171
|
+
example: '%%[\n set @count = RowCount(@results)\n]%%',
|
|
2172
|
+
},
|
|
2173
|
+
{
|
|
2174
|
+
name: 'SetObjectProperty',
|
|
2175
|
+
syntax: 'SetObjectProperty(apiObject, propertyName, value)',
|
|
2176
|
+
description: 'Assigns a value to a property on a Marketing Cloud API object created with CreateObject.',
|
|
2177
|
+
category: 'Marketing Cloud API',
|
|
2178
|
+
params: [
|
|
2179
|
+
{ name: 'apiObject', description: 'API object reference', type: 'object' },
|
|
2180
|
+
{ name: 'propertyName', description: 'Property name to set', type: 'string' },
|
|
2181
|
+
{ name: 'value', description: 'Value to assign', type: 'string' },
|
|
2182
|
+
],
|
|
2183
|
+
returnType: 'void',
|
|
2184
|
+
example: '%%[\n SetObjectProperty(@ts, "TriggeredSendDefinition", @tsDef)\n]%%',
|
|
2185
|
+
},
|
|
2186
|
+
{
|
|
2187
|
+
name: 'SetSmsConversationNextKeyword',
|
|
2188
|
+
syntax: 'SetSmsConversationNextKeyword(shortCode, mobileNumber, nextKeyword)',
|
|
2189
|
+
description: 'Changes the expected next keyword in an ongoing SMS conversation.',
|
|
2190
|
+
category: 'MobileConnect',
|
|
2191
|
+
params: [
|
|
2192
|
+
{ name: 'shortCode', description: 'Short or long code', type: 'string' },
|
|
2193
|
+
{ name: 'mobileNumber', description: 'Contact mobile number', type: 'string' },
|
|
2194
|
+
{ name: 'nextKeyword', description: 'New keyword to expect next', type: 'string' },
|
|
2195
|
+
],
|
|
2196
|
+
returnType: 'boolean',
|
|
2197
|
+
example: '%%[\n SetSmsConversationNextKeyword("12345", @mobile, "YES")\n]%%',
|
|
2198
|
+
},
|
|
2199
|
+
{
|
|
2200
|
+
name: 'SetStateMSCRMRecord',
|
|
2201
|
+
syntax: 'SetStateMSCRMRecord(entityName, entityId, state, status)',
|
|
2202
|
+
description: 'Updates the state and status of a specific Microsoft Dynamics CRM record.',
|
|
2203
|
+
category: 'Microsoft Dynamics CRM',
|
|
2204
|
+
params: [
|
|
2205
|
+
{ name: 'entityName', description: 'Entity logical name', type: 'string' },
|
|
2206
|
+
{ name: 'entityId', description: 'Record GUID', type: 'string' },
|
|
2207
|
+
{ name: 'state', description: 'State code value', type: 'string' },
|
|
2208
|
+
{ name: 'status', description: 'Status code value', type: 'string' },
|
|
2209
|
+
],
|
|
2210
|
+
returnType: 'void',
|
|
2211
|
+
example: '%%[\n SetStateMSCRMRecord("incident", @caseId, 1, 5)\n]%%',
|
|
2212
|
+
},
|
|
2213
|
+
{
|
|
2214
|
+
name: 'SetValue',
|
|
2215
|
+
syntax: 'SetValue(variableName, value)',
|
|
2216
|
+
description: 'Sets the value of an AMPscript variable from within a Server-Side JavaScript block.',
|
|
2217
|
+
category: 'Utility',
|
|
2218
|
+
params: [
|
|
2219
|
+
{
|
|
2220
|
+
name: 'variableName',
|
|
2221
|
+
description: 'Variable name (without @ in SSJS)',
|
|
2222
|
+
type: 'string',
|
|
2223
|
+
},
|
|
2224
|
+
{ name: 'value', description: 'Value to assign', type: 'string' },
|
|
2225
|
+
],
|
|
2226
|
+
returnType: 'void',
|
|
2227
|
+
example: '/* In SSJS: */\nVariable.SetValue("@greeting", "Welcome back!");',
|
|
2228
|
+
},
|
|
2229
|
+
{
|
|
2230
|
+
name: 'SHA1',
|
|
2231
|
+
syntax: 'SHA1(inputString, encoding)',
|
|
2232
|
+
description: 'Produces a SHA-1 hash of the input string as a hexadecimal string.',
|
|
2233
|
+
category: 'Encryption and Encoding',
|
|
2234
|
+
params: [
|
|
2235
|
+
{ name: 'inputString', description: 'String to hash', type: 'string' },
|
|
2236
|
+
{ name: 'encoding', description: 'Character encoding', type: 'string', optional: true },
|
|
2237
|
+
],
|
|
2238
|
+
returnType: 'string',
|
|
2239
|
+
example: '%%[\n set @sha = SHA1(@payload)\n]%%',
|
|
2240
|
+
},
|
|
2241
|
+
{
|
|
2242
|
+
name: 'SHA256',
|
|
2243
|
+
syntax: 'SHA256(inputString, encoding)',
|
|
2244
|
+
description: 'Produces a SHA-256 hash of the input string as a hexadecimal string.',
|
|
2245
|
+
category: 'Encryption and Encoding',
|
|
2246
|
+
params: [
|
|
2247
|
+
{ name: 'inputString', description: 'String to hash', type: 'string' },
|
|
2248
|
+
{ name: 'encoding', description: 'Character encoding', type: 'string', optional: true },
|
|
2249
|
+
],
|
|
2250
|
+
returnType: 'string',
|
|
2251
|
+
example: '%%[\n set @sig = SHA256(Concat(@ts, @secret))\n]%%',
|
|
2252
|
+
},
|
|
2253
|
+
{
|
|
2254
|
+
name: 'SHA512',
|
|
2255
|
+
syntax: 'SHA512(inputString, encoding)',
|
|
2256
|
+
description: 'Produces a SHA-512 hash of the input string as a hexadecimal string.',
|
|
2257
|
+
category: 'Encryption and Encoding',
|
|
2258
|
+
params: [
|
|
2259
|
+
{ name: 'inputString', description: 'String to hash', type: 'string' },
|
|
2260
|
+
{ name: 'encoding', description: 'Character encoding', type: 'string', optional: true },
|
|
2261
|
+
],
|
|
2262
|
+
returnType: 'string',
|
|
2263
|
+
example: '%%[\n set @digest = SHA512(@data)\n]%%',
|
|
2264
|
+
},
|
|
2265
|
+
{
|
|
2266
|
+
name: 'StringToDate',
|
|
2267
|
+
syntax: 'StringToDate(dateString, format)',
|
|
2268
|
+
description: 'Parses a date string using the specified format and returns a DateTime object.',
|
|
2269
|
+
category: 'Date and Time',
|
|
2270
|
+
params: [
|
|
2271
|
+
{
|
|
2272
|
+
name: 'dateString',
|
|
2273
|
+
description: 'String representation of the date',
|
|
2274
|
+
type: 'string',
|
|
2275
|
+
},
|
|
2276
|
+
{ name: 'format', description: 'Date format pattern', type: 'string', optional: true },
|
|
2277
|
+
],
|
|
2278
|
+
returnType: 'date',
|
|
2279
|
+
example: '%%[\n set @dt = StringToDate("15/03/2026", "dd/MM/yyyy")\n]%%',
|
|
2280
|
+
},
|
|
2281
|
+
{
|
|
2282
|
+
name: 'StringToHex',
|
|
2283
|
+
syntax: 'StringToHex(inputString, encoding)',
|
|
2284
|
+
description: 'Converts each character in a string to its hexadecimal representation.',
|
|
2285
|
+
category: 'Encryption and Encoding',
|
|
2286
|
+
params: [
|
|
2287
|
+
{ name: 'inputString', description: 'String to convert', type: 'string' },
|
|
2288
|
+
{ name: 'encoding', description: 'Character encoding', type: 'string', optional: true },
|
|
2289
|
+
],
|
|
2290
|
+
returnType: 'string',
|
|
2291
|
+
example: '%%[\n set @hex = StringToHex("ABC")\n]%%',
|
|
2292
|
+
},
|
|
2293
|
+
{
|
|
2294
|
+
name: 'Substring',
|
|
2295
|
+
syntax: 'Substring(inputString, startIndex, length)',
|
|
2296
|
+
description: 'Extracts a portion of a string starting at the given 1-based position for the specified number of characters.',
|
|
2297
|
+
category: 'String',
|
|
2298
|
+
params: [
|
|
2299
|
+
{ name: 'inputString', description: 'Source string', type: 'string' },
|
|
2300
|
+
{ name: 'startIndex', description: '1-based starting position', type: 'number' },
|
|
2301
|
+
{ name: 'length', description: 'Number of characters to extract', type: 'number', optional: true },
|
|
2302
|
+
],
|
|
2303
|
+
returnType: 'string',
|
|
2304
|
+
example: '%%[\n set @areaCode = Substring("5551234567", 1, 3)\n /* result: "555" */\n]%%',
|
|
2305
|
+
},
|
|
2306
|
+
{
|
|
2307
|
+
name: 'Subtract',
|
|
2308
|
+
syntax: 'Subtract(number1, number2)',
|
|
2309
|
+
description: 'Subtracts the second number from the first and returns the difference.',
|
|
2310
|
+
category: 'Math',
|
|
2311
|
+
params: [
|
|
2312
|
+
{ name: 'number1', description: 'The minuend', type: 'number' },
|
|
2313
|
+
{ name: 'number2', description: 'The subtrahend', type: 'number' },
|
|
2314
|
+
],
|
|
2315
|
+
returnType: 'number',
|
|
2316
|
+
example: '%%[\n set @remaining = Subtract(@balance, @payment)\n]%%',
|
|
2317
|
+
},
|
|
2318
|
+
{
|
|
2319
|
+
name: 'SystemDateToLocalDate',
|
|
2320
|
+
syntax: 'SystemDateToLocalDate(systemDate)',
|
|
2321
|
+
description: "Converts a Marketing Cloud system date (CST) to the subscriber's local time zone.",
|
|
2322
|
+
category: 'Date and Time',
|
|
2323
|
+
params: [
|
|
2324
|
+
{ name: 'systemDate', description: 'System date in CST to convert', type: 'date' },
|
|
2325
|
+
],
|
|
2326
|
+
returnType: 'date',
|
|
2327
|
+
example: '%%[\n set @localNow = SystemDateToLocalDate(Now())\n]%%',
|
|
2328
|
+
},
|
|
2329
|
+
{
|
|
2330
|
+
name: 'TransformXML',
|
|
2331
|
+
syntax: 'TransformXML(xmlData, xslTemplate)',
|
|
2332
|
+
description: 'Applies an XSLT stylesheet transformation to XML data and returns the result.',
|
|
2333
|
+
category: 'Content',
|
|
2334
|
+
params: [
|
|
2335
|
+
{ name: 'xmlData', description: 'Source XML string', type: 'string' },
|
|
2336
|
+
{
|
|
2337
|
+
name: 'xslTemplate',
|
|
2338
|
+
description: 'XSL transformation template string',
|
|
2339
|
+
type: 'string',
|
|
2340
|
+
},
|
|
2341
|
+
],
|
|
2342
|
+
returnType: 'string',
|
|
2343
|
+
example: '%%[\n set @html = TransformXML(@catalogXml, @xslSheet)\n]%%',
|
|
2344
|
+
},
|
|
2345
|
+
{
|
|
2346
|
+
name: 'TreatAsContent',
|
|
2347
|
+
syntax: 'TreatAsContent(contentString)',
|
|
2348
|
+
description: 'Forces AMPscript and personalization strings within the given string to be parsed and evaluated.',
|
|
2349
|
+
category: 'Content',
|
|
2350
|
+
params: [
|
|
2351
|
+
{
|
|
2352
|
+
name: 'contentString',
|
|
2353
|
+
description: 'String containing AMPscript to evaluate',
|
|
2354
|
+
type: 'string',
|
|
2355
|
+
},
|
|
2356
|
+
],
|
|
2357
|
+
returnType: 'string',
|
|
2358
|
+
example: '%%[\n set @dynamic = TreatAsContent(@templateHtml)\n]%%',
|
|
2359
|
+
},
|
|
2360
|
+
{
|
|
2361
|
+
name: 'TreatAsContentArea',
|
|
2362
|
+
syntax: 'TreatAsContentArea(key, contentString, impressionRegion)',
|
|
2363
|
+
description: 'Creates a cached content area from a string (up to 300 unique variants per send) and evaluates embedded AMPscript.',
|
|
2364
|
+
category: 'Content',
|
|
2365
|
+
params: [
|
|
2366
|
+
{ name: 'key', description: 'Cache key for the content variant', type: 'string' },
|
|
2367
|
+
{ name: 'contentString', description: 'HTML/AMPscript content', type: 'string' },
|
|
2368
|
+
{
|
|
2369
|
+
name: 'impressionRegion',
|
|
2370
|
+
description: 'Impression region name',
|
|
2371
|
+
type: 'string',
|
|
2372
|
+
optional: true,
|
|
2373
|
+
},
|
|
2374
|
+
],
|
|
2375
|
+
returnType: 'string',
|
|
2376
|
+
example: '%%[\n TreatAsContentArea(@segmentKey, @segmentHtml)\n]%%',
|
|
2377
|
+
},
|
|
2378
|
+
{
|
|
2379
|
+
name: 'Trim',
|
|
2380
|
+
syntax: 'Trim(inputString)',
|
|
2381
|
+
description: 'Strips leading and trailing whitespace from a string.',
|
|
2382
|
+
category: 'String',
|
|
2383
|
+
params: [{ name: 'inputString', description: 'String to trim', type: 'string' }],
|
|
2384
|
+
returnType: 'string',
|
|
2385
|
+
example: '%%[\n set @clean = Trim(" hello ")\n /* result: "hello" */\n]%%',
|
|
2386
|
+
},
|
|
2387
|
+
{
|
|
2388
|
+
name: 'UpdateData',
|
|
2389
|
+
syntax: 'UpdateData(dataExtension, keyCount, keyColumn, keyValue, column1, value1...)',
|
|
2390
|
+
description: 'Updates matching rows in a Data Extension. Returns count of rows updated. Landing pages and CloudPages only.',
|
|
2391
|
+
category: 'Data Extension',
|
|
2392
|
+
params: [
|
|
2393
|
+
{ name: 'dataExtension', description: 'Name of the Data Extension', type: 'string' },
|
|
2394
|
+
{ name: 'keyCount', description: 'Number of key column/value pairs', type: 'number' },
|
|
2395
|
+
{ name: 'keyColumn', description: 'Key column name for matching', type: 'string' },
|
|
2396
|
+
{ name: 'keyValue', description: 'Key value to match', type: 'string' },
|
|
2397
|
+
{ name: 'column1', description: 'Column to update', type: 'string' },
|
|
2398
|
+
{ name: 'value1', description: 'New value for column1', type: 'string' },
|
|
2399
|
+
],
|
|
2400
|
+
returnType: 'number',
|
|
2401
|
+
example: '%%[\n UpdateData("Profiles", 1, "Email", @email, "LastLogin", Now())\n]%%',
|
|
2402
|
+
},
|
|
2403
|
+
{
|
|
2404
|
+
name: 'UpdateDE',
|
|
2405
|
+
syntax: 'UpdateDE(dataExtension, keyCount, keyColumn, keyValue, column1, value1...)',
|
|
2406
|
+
description: 'Updates matching rows in a Data Extension during email sends. No return value.',
|
|
2407
|
+
category: 'Data Extension',
|
|
2408
|
+
params: [
|
|
2409
|
+
{ name: 'dataExtension', description: 'Name of the Data Extension', type: 'string' },
|
|
2410
|
+
{ name: 'keyCount', description: 'Number of key column/value pairs', type: 'number' },
|
|
2411
|
+
{ name: 'keyColumn', description: 'Key column name', type: 'string' },
|
|
2412
|
+
{ name: 'keyValue', description: 'Key value to match', type: 'string' },
|
|
2413
|
+
{ name: 'column1', description: 'Column to update', type: 'string' },
|
|
2414
|
+
{ name: 'value1', description: 'New value', type: 'string' },
|
|
2415
|
+
],
|
|
2416
|
+
returnType: 'void',
|
|
2417
|
+
example: '%%[\n UpdateDE("SendTracker", 1, "SubscriberKey", _subscriberKey, "Opens", Add(@opens, 1))\n]%%',
|
|
2418
|
+
},
|
|
2419
|
+
{
|
|
2420
|
+
name: 'UpdateMSCRMRecords',
|
|
2421
|
+
syntax: 'UpdateMSCRMRecords(entityName, setFields, filterColumn, filterValue)',
|
|
2422
|
+
description: 'Updates one or more records in a Dynamics CRM entity that match the filter. Returns the number updated.',
|
|
2423
|
+
category: 'Microsoft Dynamics CRM',
|
|
2424
|
+
params: [
|
|
2425
|
+
{ name: 'entityName', description: 'CRM entity logical name', type: 'string' },
|
|
2426
|
+
{
|
|
2427
|
+
name: 'setFields',
|
|
2428
|
+
description: 'Comma-separated field=value pairs to set',
|
|
2429
|
+
type: 'string',
|
|
2430
|
+
},
|
|
2431
|
+
{ name: 'filterColumn', description: 'Column to filter on', type: 'string' },
|
|
2432
|
+
{ name: 'filterValue', description: 'Value to match', type: 'string' },
|
|
2433
|
+
],
|
|
2434
|
+
returnType: 'number',
|
|
2435
|
+
example: '%%[\n set @updated = UpdateMSCRMRecords("contact", "statecode=0", "emailaddress1", @email)\n]%%',
|
|
2436
|
+
},
|
|
2437
|
+
{
|
|
2438
|
+
name: 'UpdateSingleSalesforceObject',
|
|
2439
|
+
syntax: 'UpdateSingleSalesforceObject(objectName, recordId, fieldName1, fieldValue1...)',
|
|
2440
|
+
description: 'Updates a single Salesforce object record. Returns 1 on success, 0 on failure.',
|
|
2441
|
+
category: 'Sales and Service Cloud',
|
|
2442
|
+
params: [
|
|
2443
|
+
{ name: 'objectName', description: 'Salesforce object API name', type: 'string' },
|
|
2444
|
+
{ name: 'recordId', description: '18-character Salesforce record ID', type: 'string' },
|
|
2445
|
+
{ name: 'fieldName1', description: 'First field to update', type: 'string' },
|
|
2446
|
+
{ name: 'fieldValue1', description: 'New value for the first field', type: 'string' },
|
|
2447
|
+
{
|
|
2448
|
+
name: 'fieldNameN',
|
|
2449
|
+
description: 'Additional field name (repeatable)',
|
|
2450
|
+
type: 'string',
|
|
2451
|
+
optional: true,
|
|
2452
|
+
},
|
|
2453
|
+
{
|
|
2454
|
+
name: 'fieldValueN',
|
|
2455
|
+
description: 'Value for the additional field (repeatable)',
|
|
2456
|
+
type: 'string',
|
|
2457
|
+
optional: true,
|
|
2458
|
+
},
|
|
2459
|
+
],
|
|
2460
|
+
returnType: 'number',
|
|
2461
|
+
example: '%%[\n set @ok = UpdateSingleSalesforceObject("Contact", @sfId, "HasOptedOutOfEmail", "true")\n]%%',
|
|
2462
|
+
},
|
|
2463
|
+
{
|
|
2464
|
+
name: 'Uppercase',
|
|
2465
|
+
syntax: 'Uppercase(inputString)',
|
|
2466
|
+
description: 'Converts every lowercase character in a string to uppercase.',
|
|
2467
|
+
category: 'String',
|
|
2468
|
+
params: [{ name: 'inputString', description: 'String to convert', type: 'string' }],
|
|
2469
|
+
returnType: 'string',
|
|
2470
|
+
example: '%%[\n set @upper = Uppercase("hello")\n /* result: "HELLO" */\n]%%',
|
|
2471
|
+
},
|
|
2472
|
+
{
|
|
2473
|
+
name: 'UpsertContact',
|
|
2474
|
+
syntax: 'UpsertContact(contactKey, keyColumn, keyValue, lookupColumn, lookupValue, fieldName, fieldValue...)',
|
|
2475
|
+
description: 'Creates a new Contact or updates an existing one in Marketing Cloud. Currently mobile-only.',
|
|
2476
|
+
category: 'MobileConnect',
|
|
2477
|
+
params: [
|
|
2478
|
+
{ name: 'contactKey', description: 'Contact key identifier', type: 'string' },
|
|
2479
|
+
{ name: 'keyColumn', description: 'Key column', type: 'string' },
|
|
2480
|
+
{ name: 'keyValue', description: 'Key value', type: 'string' },
|
|
2481
|
+
{ name: 'lookupColumn', description: 'Lookup column name', type: 'string' },
|
|
2482
|
+
{ name: 'lookupValue', description: 'Lookup value', type: 'string' },
|
|
2483
|
+
{ name: 'fieldName', description: 'Field to set', type: 'string', optional: true },
|
|
2484
|
+
{ name: 'fieldValue', description: 'Field value', type: 'string', optional: true },
|
|
2485
|
+
],
|
|
2486
|
+
returnType: 'void',
|
|
2487
|
+
example: '%%[\n UpsertContact(@contactKey, "MobileNumber", @phone, "MobileNumber", @phone)\n]%%',
|
|
2488
|
+
},
|
|
2489
|
+
{
|
|
2490
|
+
name: 'UpsertData',
|
|
2491
|
+
syntax: 'UpsertData(dataExtension, keyCount, keyColumn, keyValue, column1, value1...)',
|
|
2492
|
+
description: 'Inserts a new row or updates an existing one in a Data Extension. Returns 1 on insert, 2 on update. Landing pages/CloudPages only.',
|
|
2493
|
+
category: 'Data Extension',
|
|
2494
|
+
params: [
|
|
2495
|
+
{ name: 'dataExtension', description: 'Name of the Data Extension', type: 'string' },
|
|
2496
|
+
{ name: 'keyCount', description: 'Number of key column/value pairs', type: 'number' },
|
|
2497
|
+
{ name: 'keyColumn', description: 'Key column name', type: 'string' },
|
|
2498
|
+
{ name: 'keyValue', description: 'Key value for matching', type: 'string' },
|
|
2499
|
+
{ name: 'column1', description: 'Column to set', type: 'string' },
|
|
2500
|
+
{ name: 'value1', description: 'Value to assign', type: 'string' },
|
|
2501
|
+
],
|
|
2502
|
+
returnType: 'number',
|
|
2503
|
+
example: '%%[\n UpsertData("Preferences", 1, "Email", @email, "OptIn", "true", "UpdatedAt", Now())\n]%%',
|
|
2504
|
+
},
|
|
2505
|
+
{
|
|
2506
|
+
name: 'UpsertDE',
|
|
2507
|
+
syntax: 'UpsertDE(dataExtension, keyCount, keyColumn, keyValue, column1, value1...)',
|
|
2508
|
+
description: 'Inserts or updates a row in a Data Extension during email sends. No return value.',
|
|
2509
|
+
category: 'Data Extension',
|
|
2510
|
+
params: [
|
|
2511
|
+
{ name: 'dataExtension', description: 'Name of the Data Extension', type: 'string' },
|
|
2512
|
+
{ name: 'keyCount', description: 'Number of key column/value pairs', type: 'number' },
|
|
2513
|
+
{ name: 'keyColumn', description: 'Key column name', type: 'string' },
|
|
2514
|
+
{ name: 'keyValue', description: 'Key value for matching', type: 'string' },
|
|
2515
|
+
{ name: 'column1', description: 'Column to set', type: 'string' },
|
|
2516
|
+
{ name: 'value1', description: 'Value to assign', type: 'string' },
|
|
2517
|
+
],
|
|
2518
|
+
returnType: 'void',
|
|
2519
|
+
example: '%%[\n UpsertDE("EngagementLog", 1, "SubscriberKey", _subscriberKey, "LastSent", Now())\n]%%',
|
|
2520
|
+
},
|
|
2521
|
+
{
|
|
2522
|
+
name: 'UpsertMSCRMRecord',
|
|
2523
|
+
syntax: 'UpsertMSCRMRecord(entityName, filterField1, filterValue1, filterField2, filterValue2, setField1, setValue1, setField2, setValue2)',
|
|
2524
|
+
description: 'Updates an existing CRM record that matches the filter criteria, or creates a new one. Returns the record GUID.',
|
|
2525
|
+
category: 'Microsoft Dynamics CRM',
|
|
2526
|
+
params: [
|
|
2527
|
+
{ name: 'entityName', description: 'CRM entity logical name', type: 'string' },
|
|
2528
|
+
{ name: 'filterField1', description: 'First filter field', type: 'string' },
|
|
2529
|
+
{ name: 'filterValue1', description: 'First filter value', type: 'string' },
|
|
2530
|
+
{ name: 'filterField2', description: 'Second filter field', type: 'string' },
|
|
2531
|
+
{ name: 'filterValue2', description: 'Second filter value', type: 'string' },
|
|
2532
|
+
{ name: 'setField1', description: 'First field to set', type: 'string' },
|
|
2533
|
+
{ name: 'setValue1', description: 'Value for first field', type: 'string' },
|
|
2534
|
+
{ name: 'setField2', description: 'Second field to set', type: 'string' },
|
|
2535
|
+
{ name: 'setValue2', description: 'Value for second field', type: 'string' },
|
|
2536
|
+
],
|
|
2537
|
+
returnType: 'string',
|
|
2538
|
+
example: '%%[\n set @guid = UpsertMSCRMRecord("contact", "email", @email, "", "", "firstname", @fName, "lastname", @lName)\n]%%',
|
|
2539
|
+
},
|
|
2540
|
+
{
|
|
2541
|
+
name: 'URLEncode',
|
|
2542
|
+
syntax: 'URLEncode(inputString, convertToHex, charset)',
|
|
2543
|
+
description: 'Percent-encodes a string so it can be safely used as a URL parameter value.',
|
|
2544
|
+
category: 'Encryption and Encoding',
|
|
2545
|
+
params: [
|
|
2546
|
+
{ name: 'inputString', description: 'String to encode', type: 'string' },
|
|
2547
|
+
{
|
|
2548
|
+
name: 'convertToHex',
|
|
2549
|
+
description: 'Whether to use hex encoding',
|
|
2550
|
+
type: 'boolean',
|
|
2551
|
+
optional: true,
|
|
2552
|
+
},
|
|
2553
|
+
{
|
|
2554
|
+
name: 'charset',
|
|
2555
|
+
description: 'Character set to use',
|
|
2556
|
+
type: 'string',
|
|
2557
|
+
optional: true,
|
|
2558
|
+
},
|
|
2559
|
+
],
|
|
2560
|
+
returnType: 'string',
|
|
2561
|
+
example: '%%[\n set @encoded = URLEncode(@searchQuery)\n]%%',
|
|
2562
|
+
},
|
|
2563
|
+
{
|
|
2564
|
+
name: 'V',
|
|
2565
|
+
syntax: 'V(variable)',
|
|
2566
|
+
description: 'Outputs the value of an AMPscript variable. Typically used in inline expressions to display variable values.',
|
|
2567
|
+
category: 'Utility',
|
|
2568
|
+
params: [{ name: 'variable', description: 'AMPscript variable reference', type: 'string' }],
|
|
2569
|
+
returnType: 'string',
|
|
2570
|
+
example: '<p>Hello, %%=V(@displayName)=%%!</p>',
|
|
2571
|
+
},
|
|
2572
|
+
{
|
|
2573
|
+
name: 'WAT',
|
|
2574
|
+
syntax: 'WAT(trackingId, param1, param2...)',
|
|
2575
|
+
description: 'Generates Web Analytics Tracking parameter strings that can be appended to URLs.',
|
|
2576
|
+
category: 'Utility',
|
|
2577
|
+
params: [
|
|
2578
|
+
{
|
|
2579
|
+
name: 'trackingId',
|
|
2580
|
+
description: 'Web Analytics Tracking configuration ID',
|
|
2581
|
+
type: 'string',
|
|
2582
|
+
},
|
|
2583
|
+
{
|
|
2584
|
+
name: 'param1',
|
|
2585
|
+
description: 'First parameter replacement value',
|
|
2586
|
+
type: 'string',
|
|
2587
|
+
optional: true,
|
|
2588
|
+
},
|
|
2589
|
+
{
|
|
2590
|
+
name: 'param2',
|
|
2591
|
+
description: 'Additional parameter values',
|
|
2592
|
+
type: 'string',
|
|
2593
|
+
optional: true,
|
|
2594
|
+
},
|
|
2595
|
+
],
|
|
2596
|
+
returnType: 'string',
|
|
2597
|
+
example: '%%=WAT(1, @campaignName, @channelId)=%%',
|
|
2598
|
+
},
|
|
2599
|
+
{
|
|
2600
|
+
name: 'WATP',
|
|
2601
|
+
syntax: 'WATP(ordinal)',
|
|
2602
|
+
description: 'Placeholder function for WAT parameter values. Replaced at render time within WAT strings.',
|
|
2603
|
+
category: 'Utility',
|
|
2604
|
+
params: [
|
|
2605
|
+
{
|
|
2606
|
+
name: 'ordinal',
|
|
2607
|
+
description: 'Ordinal position (1-based) of the parameter',
|
|
2608
|
+
type: 'number',
|
|
2609
|
+
},
|
|
2610
|
+
],
|
|
2611
|
+
returnType: 'string',
|
|
2612
|
+
example: '/* Used inside WAT configuration strings */\nWATP(1)',
|
|
2613
|
+
},
|
|
2614
|
+
{
|
|
2615
|
+
name: 'WrapLongURL',
|
|
2616
|
+
syntax: 'WrapLongURL(url)',
|
|
2617
|
+
description: 'Shortens URLs exceeding 975 characters by replacing them with a platform redirect, preventing broken links in Outlook.',
|
|
2618
|
+
category: 'Utility',
|
|
2619
|
+
params: [{ name: 'url', description: 'Potentially long URL to wrap', type: 'string' }],
|
|
2620
|
+
returnType: 'string',
|
|
2621
|
+
example: '<a href="%%=RedirectTo(WrapLongURL(@longUrl))=%%">Click here</a>',
|
|
2622
|
+
},
|
|
2623
|
+
];
|
|
2624
|
+
/**
|
|
2625
|
+
* AMPscript keywords for auto-completion.
|
|
2626
|
+
*/
|
|
2627
|
+
export const ampscriptKeywords = [
|
|
2628
|
+
{
|
|
2629
|
+
name: 'var',
|
|
2630
|
+
description: 'Declares one or more variables',
|
|
2631
|
+
snippet: 'var @${1:variableName}',
|
|
2632
|
+
},
|
|
2633
|
+
{
|
|
2634
|
+
name: 'set',
|
|
2635
|
+
description: 'Assigns a value to a variable',
|
|
2636
|
+
snippet: 'set @${1:variableName} = ${2:value}',
|
|
2637
|
+
},
|
|
2638
|
+
{
|
|
2639
|
+
name: 'if',
|
|
2640
|
+
description: 'Begins a conditional block',
|
|
2641
|
+
snippet: 'if ${1:condition} then\n\t${2}\nendif',
|
|
2642
|
+
},
|
|
2643
|
+
{
|
|
2644
|
+
name: 'elseif',
|
|
2645
|
+
description: 'Additional condition in an if block',
|
|
2646
|
+
snippet: 'elseif ${1:condition} then',
|
|
2647
|
+
},
|
|
2648
|
+
{ name: 'else', description: 'Fallback branch in an if block', snippet: 'else' },
|
|
2649
|
+
{ name: 'endif', description: 'Closes an if block', snippet: 'endif' },
|
|
2650
|
+
{
|
|
2651
|
+
name: 'for',
|
|
2652
|
+
description: 'Begins a counting loop',
|
|
2653
|
+
snippet: 'for @${1:i} = ${2:1} to ${3:rowCount} do\n\t${4}\nnext @${1:i}',
|
|
2654
|
+
},
|
|
2655
|
+
{ name: 'to', description: 'Ascending direction in a for loop', snippet: 'to' },
|
|
2656
|
+
{ name: 'downto', description: 'Descending direction in a for loop', snippet: 'downto' },
|
|
2657
|
+
{ name: 'do', description: 'Marks the start of a loop body', snippet: 'do' },
|
|
2658
|
+
{ name: 'next', description: 'Ends a for loop iteration', snippet: 'next' },
|
|
2659
|
+
{ name: 'and', description: 'Logical AND operator', snippet: 'and' },
|
|
2660
|
+
{ name: 'or', description: 'Logical OR operator', snippet: 'or' },
|
|
2661
|
+
{ name: 'not', description: 'Logical NOT operator', snippet: 'not' },
|
|
2662
|
+
{ name: 'then', description: 'Follows an if/elseif condition', snippet: 'then' },
|
|
2663
|
+
{ name: 'true', description: 'Boolean true constant', snippet: 'true' },
|
|
2664
|
+
{ name: 'false', description: 'Boolean false constant', snippet: 'false' },
|
|
2665
|
+
];
|
|
2666
|
+
/**
|
|
2667
|
+
* Common system personalization strings.
|
|
2668
|
+
*/
|
|
2669
|
+
export const personalizationStrings = [
|
|
2670
|
+
// Subscriber identity
|
|
2671
|
+
{
|
|
2672
|
+
name: '_subscriberKey',
|
|
2673
|
+
description: 'Unique key identifying the current subscriber/contact',
|
|
2674
|
+
},
|
|
2675
|
+
{ name: 'emailaddr', description: 'Email address of the current subscriber' },
|
|
2676
|
+
{
|
|
2677
|
+
name: 'subscriberid',
|
|
2678
|
+
description: 'Numeric ID of the subscriber in the All Subscribers list',
|
|
2679
|
+
},
|
|
2680
|
+
{ name: 'firstname', description: 'Subscriber first name attribute' },
|
|
2681
|
+
{ name: 'lastname', description: 'Subscriber last name attribute' },
|
|
2682
|
+
{ name: 'fullname', description: 'Subscriber full name attribute' },
|
|
2683
|
+
// Email/job metadata
|
|
2684
|
+
{ name: 'emailname_', description: 'Name of the current email message' },
|
|
2685
|
+
{ name: '_emailid', description: 'Numeric ID of the current email' },
|
|
2686
|
+
{ name: 'jobid', description: 'Numeric job identifier of the current send' },
|
|
2687
|
+
{ name: '_JobSubscriberBatchID', description: 'Batch identifier within the send job' },
|
|
2688
|
+
{ name: '_PreHeader', description: 'Preheader text for the current email' },
|
|
2689
|
+
{ name: '_DataSourceName', description: 'Name of the data source used for the send' },
|
|
2690
|
+
// Send context
|
|
2691
|
+
{
|
|
2692
|
+
name: '_messageContext',
|
|
2693
|
+
description: 'Render context: "SEND", "PREVIEW", "VAWP", or "FTAF"',
|
|
2694
|
+
},
|
|
2695
|
+
{ name: '_isTestSend', description: 'Boolean indicating whether this is a test send' },
|
|
2696
|
+
{
|
|
2697
|
+
name: '_messagetypepreference',
|
|
2698
|
+
description: 'Subscriber preference for HTML or text-only messages',
|
|
2699
|
+
},
|
|
2700
|
+
// List information
|
|
2701
|
+
{ name: 'listid', description: 'Numeric ID of the current send list' },
|
|
2702
|
+
{ name: '_listname', description: 'Name of the current send list' },
|
|
2703
|
+
{ name: 'list_', description: 'Name of the list associated with the subscriber' },
|
|
2704
|
+
{ name: 'listsubid', description: 'Subscriber ID within the specific list' },
|
|
2705
|
+
// Email dates (system-generated)
|
|
2706
|
+
{ name: 'xtmonth', description: 'Full month name of the send date (e.g. "March")' },
|
|
2707
|
+
{ name: 'xtmonthnumeric', description: 'Numeric month of the send date (1-12)' },
|
|
2708
|
+
{ name: 'xtday', description: 'Day of month of the send date' },
|
|
2709
|
+
{ name: 'xtdayofweek', description: 'Day of week of the send date (e.g. "Friday")' },
|
|
2710
|
+
{ name: 'xtyear', description: 'Four-digit year of the send date' },
|
|
2711
|
+
{ name: 'xtshortdate', description: 'Short date format of the send date' },
|
|
2712
|
+
{ name: 'xtlongdate', description: 'Long date format of the send date' },
|
|
2713
|
+
// Sender/Business Unit
|
|
2714
|
+
{ name: 'replyname', description: 'Reply-to display name for the current send' },
|
|
2715
|
+
{ name: 'replyemailaddress', description: 'Reply-to email address for the current send' },
|
|
2716
|
+
{ name: 'memberid', description: 'MID (Member ID) of the sending business unit' },
|
|
2717
|
+
{ name: 'member_busname', description: 'Business name of the sending business unit' },
|
|
2718
|
+
{ name: 'member_addr', description: 'Street address of the sending business unit' },
|
|
2719
|
+
{ name: 'member_city', description: 'City of the sending business unit' },
|
|
2720
|
+
{ name: 'member_state', description: 'State/province of the sending business unit' },
|
|
2721
|
+
{ name: 'member_postalcode', description: 'Postal code of the sending business unit' },
|
|
2722
|
+
{ name: 'member_country', description: 'Country of the sending business unit' },
|
|
2723
|
+
// Standard URLs
|
|
2724
|
+
{
|
|
2725
|
+
name: 'view_email_url',
|
|
2726
|
+
description: 'URL to view the email in a browser (View as Web Page)',
|
|
2727
|
+
},
|
|
2728
|
+
{ name: 'ftaf_url', description: 'Forward to a Friend URL' },
|
|
2729
|
+
{ name: 'subscription_center_url', description: 'URL to the subscription center' },
|
|
2730
|
+
{ name: 'profile_center_url', description: 'URL to the profile center' },
|
|
2731
|
+
{ name: 'unsub_center_url', description: 'URL to the unsubscribe center' },
|
|
2732
|
+
{ name: 'double_opt_in_url', description: 'URL for double opt-in confirmation' },
|
|
2733
|
+
// Reply Mail Management (RMM)
|
|
2734
|
+
{
|
|
2735
|
+
name: '_replycontent',
|
|
2736
|
+
description: 'Body text of a subscriber reply (Reply Mail Management)',
|
|
2737
|
+
},
|
|
2738
|
+
// Link tracking
|
|
2739
|
+
{ name: 'linkname', description: 'Name/alias of the current tracked link' },
|
|
2740
|
+
// Impression regions
|
|
2741
|
+
{ name: '_ImpressionRegionID', description: 'Numeric ID of the current impression region' },
|
|
2742
|
+
{ name: '_ImpressionRegionName', description: 'Name of the current impression region' },
|
|
2743
|
+
// Web/CloudPages context
|
|
2744
|
+
{ name: 'PAGEURL', description: 'URL of the current CloudPages or microsite page' },
|
|
2745
|
+
// MobileConnect (SMS)
|
|
2746
|
+
{ name: 'MOBILE_NUMBER', description: 'Mobile number of the inbound SMS sender' },
|
|
2747
|
+
{ name: 'SHORT_CODE', description: 'Short code or long code receiving the SMS' },
|
|
2748
|
+
{ name: 'MSG(0)', description: 'Full text of the inbound SMS message' },
|
|
2749
|
+
{ name: 'MSG(0).VERB', description: 'First word (keyword) of the inbound SMS' },
|
|
2750
|
+
{ name: 'MSG(0).NOUNS', description: 'Everything after the keyword in the inbound SMS' },
|
|
2751
|
+
{ name: 'MSG(0).NOUN(1)', description: 'Second word of the inbound SMS message' },
|
|
2752
|
+
{ name: 'MMS_CONTENT_URL(0)', description: 'URL of the first MMS attachment' },
|
|
2753
|
+
// MobileConnect contact demographics
|
|
2754
|
+
{ name: '_CarrierID', description: 'MobileConnect: carrier identifier for the contact' },
|
|
2755
|
+
{ name: '_Channel', description: 'MobileConnect: messaging channel for the contact' },
|
|
2756
|
+
{ name: '_City', description: 'MobileConnect: city from contact demographics' },
|
|
2757
|
+
{ name: '_ContactID', description: 'MobileConnect: contact identifier' },
|
|
2758
|
+
{ name: '_CountryCode', description: 'MobileConnect: country code from contact demographics' },
|
|
2759
|
+
{ name: '_CreatedBy', description: 'MobileConnect: user who created the contact record' },
|
|
2760
|
+
{ name: '_CreatedDate', description: 'MobileConnect: date the contact record was created' },
|
|
2761
|
+
{ name: '_FirstName', description: 'MobileConnect: contact first name' },
|
|
2762
|
+
{ name: '_LastName', description: 'MobileConnect: contact last name' },
|
|
2763
|
+
{ name: '_MobileNumber', description: 'MobileConnect: mobile number of the contact' },
|
|
2764
|
+
{ name: '_ModifiedBy', description: 'MobileConnect: user who last modified the contact' },
|
|
2765
|
+
{ name: '_ModifiedDate', description: 'MobileConnect: date the contact was last modified' },
|
|
2766
|
+
{ name: '_Priority', description: 'MobileConnect: message priority for the contact' },
|
|
2767
|
+
{ name: '_Source', description: 'MobileConnect: how the contact was added' },
|
|
2768
|
+
{ name: '_SourceObjectID', description: 'MobileConnect: source object identifier' },
|
|
2769
|
+
{ name: '_State', description: 'MobileConnect: state from contact demographics' },
|
|
2770
|
+
{
|
|
2771
|
+
name: '_Status',
|
|
2772
|
+
description: 'MobileConnect: subscription status (Active, Unsubscribed, etc.)',
|
|
2773
|
+
},
|
|
2774
|
+
{ name: '_UTCOffset', description: 'MobileConnect: UTC offset for the contact timezone' },
|
|
2775
|
+
{ name: '_ZipCode', description: 'MobileConnect: ZIP/postal code from contact demographics' },
|
|
2776
|
+
// GroupConnect / LINE
|
|
2777
|
+
{ name: 'LINE_ADDRESS_ID', description: 'GroupConnect: LINE user address identifier' },
|
|
2778
|
+
// Execution context
|
|
2779
|
+
{
|
|
2780
|
+
name: '@@ExecCtx',
|
|
2781
|
+
description: 'Execution context: returns "load" or "post" on web pages (known bug: may always return "load")',
|
|
2782
|
+
},
|
|
2783
|
+
];
|
|
2784
|
+
/**
|
|
2785
|
+
* Build a lookup map for fast case-insensitive function retrieval.
|
|
2786
|
+
*/
|
|
2787
|
+
export const functionLookup = new Map();
|
|
2788
|
+
for (const function_ of ampscriptFunctions) {
|
|
2789
|
+
functionLookup.set(function_.name.toLowerCase(), function_);
|
|
2790
|
+
}
|
|
2791
|
+
//# sourceMappingURL=ampscript.js.map
|