ampscript-data 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.
Files changed (3) hide show
  1. package/README.md +141 -0
  2. package/package.json +32 -0
  3. package/src/index.js +2896 -0
package/src/index.js ADDED
@@ -0,0 +1,2896 @@
1
+ /**
2
+ * Canonical AMPscript function catalog, keywords, and personalization strings.
3
+ *
4
+ * Single source of truth consumed by:
5
+ * - prettier-plugin-sfmc (casing normalization)
6
+ * - eslint-plugin-sfmc (unknown-function detection, arity validation)
7
+ * - vscode-sfmc-language (completions, hover, diagnostics)
8
+ */
9
+
10
+ const INF = Infinity;
11
+
12
+ // ── Function catalog ─────────────────────────────────────────────────────────
13
+
14
+ /** @type {Array<{name:string, minArgs:number, maxArgs:number, category:string, description:string, params:Array<{name:string, description:string, type?:string, optional?:boolean}>, returnType?:string, syntax?:string, example?:string}>} */
15
+ export const FUNCTIONS = [
16
+ {
17
+ name: 'Add',
18
+ minArgs: 2,
19
+ maxArgs: 2,
20
+ category: 'Math',
21
+ description: 'Computes the sum of two numeric values.',
22
+ params: [
23
+ { name: 'number1', description: 'First operand', type: 'number' },
24
+ { name: 'number2', description: 'Second operand', type: 'number' },
25
+ ],
26
+ returnType: 'number',
27
+ syntax: 'Add(number1, number2)',
28
+ example: '%%=Add(15, 27)=%%',
29
+ },
30
+ {
31
+ name: 'AddMSCRMListMember',
32
+ minArgs: 2,
33
+ maxArgs: 2,
34
+ category: 'Microsoft Dynamics CRM',
35
+ description: 'Appends a member to a Dynamics CRM list.',
36
+ params: [
37
+ { name: 'listID', description: 'CRM list identifier', type: 'string' },
38
+ { name: 'entityID', description: 'Entity to add', type: 'string' },
39
+ ],
40
+ returnType: 'void',
41
+ syntax: 'AddMSCRMListMember(listID, entityID)',
42
+ },
43
+ {
44
+ name: 'AddObjectArrayItem',
45
+ minArgs: 3,
46
+ maxArgs: 3,
47
+ category: 'Marketing Cloud API',
48
+ description: "Appends an item to an API object's array property.",
49
+ params: [
50
+ { name: 'apiObject', description: 'API object reference' },
51
+ { name: 'propertyName', description: 'Array property name', type: 'string' },
52
+ { name: 'value', description: 'Value to append' },
53
+ ],
54
+ returnType: 'void',
55
+ syntax: 'AddObjectArrayItem(apiObject, propertyName, value)',
56
+ },
57
+ {
58
+ name: 'AttachFile',
59
+ minArgs: 4,
60
+ maxArgs: 8,
61
+ category: 'Content',
62
+ description: 'Includes a file attachment in the outgoing message.',
63
+ params: [
64
+ { name: 'portfolio', description: 'Portfolio source', type: 'string' },
65
+ { name: 'customerKey', description: 'File customer key', type: 'string' },
66
+ { name: 'fileName', description: 'Attachment display name', type: 'string' },
67
+ { name: 'mimeType', description: 'MIME type', type: 'string' },
68
+ { name: 'isInline', description: 'Display inline', type: 'boolean', optional: true },
69
+ {
70
+ name: 'contentDisposition',
71
+ description: 'Disposition header',
72
+ type: 'string',
73
+ optional: true,
74
+ },
75
+ { name: 'encoding', description: 'Character encoding', type: 'string', optional: true },
76
+ {
77
+ name: 'contentId',
78
+ description: 'Content-ID for inline',
79
+ type: 'string',
80
+ optional: true,
81
+ },
82
+ ],
83
+ returnType: 'void',
84
+ syntax: 'AttachFile(portfolio, customerKey, fileName, mimeType[, isInline, contentDisposition, encoding, contentId])',
85
+ },
86
+ {
87
+ name: 'AttributeValue',
88
+ minArgs: 1,
89
+ maxArgs: 1,
90
+ category: 'Utility',
91
+ description:
92
+ 'Safely retrieves a subscriber attribute value, returning empty string if null.',
93
+ params: [{ name: 'attributeName', description: 'Attribute name', type: 'string' }],
94
+ returnType: 'string',
95
+ syntax: 'AttributeValue(attributeName)',
96
+ example: "%%=AttributeValue('firstname')=%%",
97
+ },
98
+ {
99
+ name: 'AuthenticatedEmployeeID',
100
+ minArgs: 0,
101
+ maxArgs: 0,
102
+ category: 'Utility',
103
+ description: 'Returns the employee ID of the currently authenticated user.',
104
+ params: [],
105
+ returnType: 'string',
106
+ syntax: 'AuthenticatedEmployeeID()',
107
+ },
108
+ {
109
+ name: 'AuthenticatedEmployeeNotificationAddress',
110
+ minArgs: 0,
111
+ maxArgs: 0,
112
+ category: 'Utility',
113
+ description: 'Returns the notification email address of the authenticated employee.',
114
+ params: [],
115
+ returnType: 'string',
116
+ syntax: 'AuthenticatedEmployeeNotificationAddress()',
117
+ },
118
+ {
119
+ name: 'AuthenticatedEmployeeUserName',
120
+ minArgs: 0,
121
+ maxArgs: 0,
122
+ category: 'Utility',
123
+ description: 'Returns the username of the authenticated employee.',
124
+ params: [],
125
+ returnType: 'string',
126
+ syntax: 'AuthenticatedEmployeeUserName()',
127
+ },
128
+ {
129
+ name: 'AuthenticatedEnterpriseID',
130
+ minArgs: 0,
131
+ maxArgs: 0,
132
+ category: 'Utility',
133
+ description: 'Returns the enterprise ID (top-level MID) of the authenticated user.',
134
+ params: [],
135
+ returnType: 'string',
136
+ syntax: 'AuthenticatedEnterpriseID()',
137
+ },
138
+ {
139
+ name: 'AuthenticatedMemberID',
140
+ minArgs: 0,
141
+ maxArgs: 0,
142
+ category: 'Utility',
143
+ description: 'Returns the member ID (MID) of the authenticated business unit.',
144
+ params: [],
145
+ returnType: 'string',
146
+ syntax: 'AuthenticatedMemberID()',
147
+ },
148
+ {
149
+ name: 'AuthenticatedMemberName',
150
+ minArgs: 0,
151
+ maxArgs: 0,
152
+ category: 'Utility',
153
+ description: 'Returns the name of the authenticated business unit.',
154
+ params: [],
155
+ returnType: 'string',
156
+ syntax: 'AuthenticatedMemberName()',
157
+ },
158
+ {
159
+ name: 'BarcodeURL',
160
+ minArgs: 9,
161
+ maxArgs: 9,
162
+ category: 'Content',
163
+ description:
164
+ 'Generates a URL pointing to a barcode image rendered from the given parameters.',
165
+ params: [
166
+ { name: 'barcodeType', description: 'Barcode type (e.g. Code128, QR)', type: 'string' },
167
+ { name: 'barcodeValue', description: 'Data to encode', type: 'string' },
168
+ { name: 'width', description: 'Image width in pixels', type: 'number' },
169
+ { name: 'height', description: 'Image height in pixels', type: 'number' },
170
+ { name: 'imageFormat', description: 'Output format (GIF, PNG, JPG)', type: 'string' },
171
+ { name: 'quality', description: 'Quality percentage (1\u2013100)', type: 'number' },
172
+ { name: 'foregroundColor', description: 'Bar color as hex', type: 'string' },
173
+ { name: 'backgroundColor', description: 'Background color as hex', type: 'string' },
174
+ { name: 'caption', description: 'Caption text below barcode', type: 'string' },
175
+ ],
176
+ returnType: 'string',
177
+ syntax: 'BarcodeURL(barcodeType, barcodeValue, width, height, imageFormat, quality, foregroundColor, backgroundColor, caption)',
178
+ },
179
+ {
180
+ name: 'Base64Decode',
181
+ minArgs: 1,
182
+ maxArgs: 3,
183
+ category: 'Encryption and Encoding',
184
+ description: 'Decodes a Base64-encoded string.',
185
+ params: [
186
+ { name: 'encodedString', description: 'Base64 string to decode', type: 'string' },
187
+ { name: 'encoding', description: 'Encoding scheme', type: 'string', optional: true },
188
+ {
189
+ name: 'characterSet',
190
+ description: 'Character set for output',
191
+ type: 'string',
192
+ optional: true,
193
+ },
194
+ ],
195
+ returnType: 'string',
196
+ syntax: 'Base64Decode(encodedString[, encoding, characterSet])',
197
+ example: "%%=Base64Decode('SGVsbG8=')=%%",
198
+ },
199
+ {
200
+ name: 'Base64Encode',
201
+ minArgs: 1,
202
+ maxArgs: 2,
203
+ category: 'Encryption and Encoding',
204
+ description: 'Encodes a value as a Base64 string.',
205
+ params: [
206
+ { name: 'value', description: 'Value to encode', type: 'string' },
207
+ { name: 'encoding', description: 'Encoding scheme', type: 'string', optional: true },
208
+ ],
209
+ returnType: 'string',
210
+ syntax: 'Base64Encode(value[, encoding])',
211
+ example: "%%=Base64Encode('Hello')=%%",
212
+ },
213
+ {
214
+ name: 'BeginImpressionRegion',
215
+ minArgs: 1,
216
+ maxArgs: 1,
217
+ category: 'Content',
218
+ description: 'Marks the start of an impression tracking region.',
219
+ params: [{ name: 'regionName', description: 'Impression region name', type: 'string' }],
220
+ returnType: 'void',
221
+ syntax: 'BeginImpressionRegion(regionName)',
222
+ },
223
+ {
224
+ name: 'BuildOptionList',
225
+ minArgs: 3,
226
+ maxArgs: INF,
227
+ category: 'Content',
228
+ description:
229
+ 'Builds HTML <option> elements from a data extension for use in a <select> dropdown.',
230
+ params: [
231
+ {
232
+ name: 'dataExtensionName',
233
+ description: 'Data extension to read from',
234
+ type: 'string',
235
+ },
236
+ { name: 'selectedValue', description: 'Value to mark as selected', type: 'string' },
237
+ {
238
+ name: 'displayColumn',
239
+ description: 'Column for option display text',
240
+ type: 'string',
241
+ },
242
+ {
243
+ name: 'valueColumn',
244
+ description: 'Column for option value attribute',
245
+ type: 'string',
246
+ optional: true,
247
+ },
248
+ ],
249
+ returnType: 'string',
250
+ syntax: 'BuildOptionList(dataExtensionName, selectedValue, displayColumn[, valueColumn, ...])',
251
+ },
252
+ {
253
+ name: 'BuildRowsetFromJSON',
254
+ minArgs: 2,
255
+ maxArgs: 3,
256
+ category: 'Content',
257
+ description: 'Parses a JSON string and returns a rowset.',
258
+ params: [
259
+ { name: 'json', description: 'JSON string to parse', type: 'string' },
260
+ {
261
+ name: 'jsonPath',
262
+ description: 'JSONPath expression for node selection',
263
+ type: 'string',
264
+ },
265
+ {
266
+ name: 'uniqueTag',
267
+ description: 'Unique tag for the rowset',
268
+ type: 'string',
269
+ optional: true,
270
+ },
271
+ ],
272
+ returnType: 'rowset',
273
+ syntax: 'BuildRowsetFromJSON(json, jsonPath[, uniqueTag])',
274
+ },
275
+ {
276
+ name: 'BuildRowSetFromString',
277
+ minArgs: 2,
278
+ maxArgs: 2,
279
+ category: 'Content',
280
+ description: 'Splits a delimited string into a single-column rowset.',
281
+ params: [
282
+ { name: 'inputString', description: 'Delimited string', type: 'string' },
283
+ { name: 'delimiter', description: 'Delimiter character', type: 'string' },
284
+ ],
285
+ returnType: 'rowset',
286
+ syntax: 'BuildRowSetFromString(inputString, delimiter)',
287
+ example: "%%=BuildRowSetFromString('a,b,c', ',')=%%",
288
+ },
289
+ {
290
+ name: 'BuildRowSetFromXML',
291
+ minArgs: 2,
292
+ maxArgs: 3,
293
+ category: 'Content',
294
+ description: 'Parses an XML string using an XPath expression and returns a rowset.',
295
+ params: [
296
+ { name: 'xml', description: 'XML string to parse', type: 'string' },
297
+ { name: 'xpath', description: 'XPath expression', type: 'string' },
298
+ {
299
+ name: 'isCaseSensitive',
300
+ description: 'Enable case-sensitive matching',
301
+ type: 'boolean',
302
+ optional: true,
303
+ },
304
+ ],
305
+ returnType: 'rowset',
306
+ syntax: 'BuildRowSetFromXML(xml, xpath[, isCaseSensitive])',
307
+ },
308
+ {
309
+ name: 'Char',
310
+ minArgs: 1,
311
+ maxArgs: 2,
312
+ category: 'String',
313
+ description: 'Returns the character for the given ASCII code.',
314
+ params: [
315
+ { name: 'asciiCode', description: 'ASCII character code', type: 'number' },
316
+ {
317
+ name: 'repeatCount',
318
+ description: 'Number of times to repeat the returned character',
319
+ type: 'number',
320
+ optional: true,
321
+ },
322
+ ],
323
+ returnType: 'string',
324
+ syntax: 'Char(asciiCode[, repeatCount])',
325
+ example: '%%=Char(10)=%%',
326
+ },
327
+ {
328
+ name: 'ClaimRow',
329
+ minArgs: 4,
330
+ maxArgs: INF,
331
+ category: 'Data Extension',
332
+ description:
333
+ 'Atomically claims an unclaimed row in a data extension by setting a key column value.',
334
+ params: [
335
+ {
336
+ name: 'dataExtensionName',
337
+ description: 'Target data extension name',
338
+ type: 'string',
339
+ },
340
+ {
341
+ name: 'claimedColumn',
342
+ description: 'Name of the boolean column that identifies a row as claimed',
343
+ type: 'string',
344
+ },
345
+ {
346
+ name: 'columnName',
347
+ description: 'Name of the column to populate when claiming the row',
348
+ type: 'string',
349
+ },
350
+ {
351
+ name: 'columnValue',
352
+ description: 'Value to write into the column when claiming the row',
353
+ },
354
+ {
355
+ name: 'additionalColumnName',
356
+ description: 'Additional column name to populate',
357
+ type: 'string',
358
+ optional: true,
359
+ },
360
+ {
361
+ name: 'additionalColumnValue',
362
+ description: 'Additional column value to populate',
363
+ optional: true,
364
+ },
365
+ ],
366
+ returnType: 'row',
367
+ syntax: 'ClaimRow(dataExtensionName, claimedColumn, columnName, columnValue[, additionalColumnName, additionalColumnValue, ...])',
368
+ },
369
+ {
370
+ name: 'ClaimRowValue',
371
+ minArgs: 3,
372
+ maxArgs: INF,
373
+ category: 'Data Extension',
374
+ description: 'Atomically claims a row and returns a specific column value from it.',
375
+ params: [
376
+ {
377
+ name: 'dataExtensionName',
378
+ description: 'Target data extension name',
379
+ type: 'string',
380
+ },
381
+ { name: 'returnColumn', description: 'Column whose value to return', type: 'string' },
382
+ {
383
+ name: 'claimedColumn',
384
+ description: 'Name of the boolean column that identifies a row as claimed',
385
+ type: 'string',
386
+ },
387
+ {
388
+ name: 'defaultValue',
389
+ description: 'Default value to return if no unclaimed rows are available',
390
+ optional: true,
391
+ },
392
+ {
393
+ name: 'columnName',
394
+ description: 'Name of the column to populate when claiming the row',
395
+ type: 'string',
396
+ optional: true,
397
+ },
398
+ {
399
+ name: 'columnValue',
400
+ description: 'Value to write into the column when claiming the row',
401
+ optional: true,
402
+ },
403
+ ],
404
+ returnType: 'string',
405
+ syntax: 'ClaimRowValue(dataExtensionName, returnColumn, claimedColumn[, defaultValue, columnName, columnValue, ...])',
406
+ },
407
+ {
408
+ name: 'CloudPagesURL',
409
+ minArgs: 1,
410
+ maxArgs: INF,
411
+ category: 'Utility',
412
+ description:
413
+ 'Generates a secure, encrypted URL to a CloudPages landing page, optionally passing name-value parameters.',
414
+ params: [
415
+ { name: 'pageId', description: 'CloudPages page ID', type: 'number' },
416
+ {
417
+ name: 'paramName',
418
+ description: 'Query parameter name',
419
+ type: 'string',
420
+ optional: true,
421
+ },
422
+ {
423
+ name: 'paramValue',
424
+ description: 'Query parameter value',
425
+ type: 'string',
426
+ optional: true,
427
+ },
428
+ ],
429
+ returnType: 'string',
430
+ syntax: 'CloudPagesURL(pageId[, paramName1, paramValue1, ...])',
431
+ example: "%%=CloudPagesURL(123, 'key', 'value')=%%",
432
+ },
433
+ {
434
+ name: 'Concat',
435
+ minArgs: 2,
436
+ maxArgs: INF,
437
+ category: 'String',
438
+ description: 'Concatenates two or more string values.',
439
+ params: [
440
+ { name: 'string1', description: 'First string', type: 'string' },
441
+ { name: 'string2', description: 'Second string', type: 'string' },
442
+ { name: 'stringN', description: 'Additional string', type: 'string', optional: true },
443
+ ],
444
+ returnType: 'string',
445
+ syntax: 'Concat(string1, string2[, ...])',
446
+ example: "%%=Concat('Hello', ' ', 'World')=%%",
447
+ },
448
+ {
449
+ name: 'ContentArea',
450
+ minArgs: 1,
451
+ maxArgs: 5,
452
+ category: 'Content',
453
+ description: 'Inserts a classic content area by its numeric ID.',
454
+ params: [
455
+ { name: 'contentAreaId', description: 'Content area ID', type: 'number' },
456
+ {
457
+ name: 'impressionRegion',
458
+ description: 'Impression region name',
459
+ type: 'string',
460
+ optional: true,
461
+ },
462
+ {
463
+ name: 'layout',
464
+ description: 'Layout option (block or wrap)',
465
+ type: 'string',
466
+ optional: true,
467
+ },
468
+ { name: 'tag', description: 'Wrapping HTML tag', type: 'string', optional: true },
469
+ {
470
+ name: 'errorMessage',
471
+ description: 'Error message if content not found',
472
+ type: 'string',
473
+ optional: true,
474
+ },
475
+ ],
476
+ returnType: 'string',
477
+ syntax: 'ContentArea(contentAreaId[, impressionRegion, layout, tag, errorMessage])',
478
+ },
479
+ {
480
+ name: 'ContentAreaByName',
481
+ minArgs: 1,
482
+ maxArgs: 5,
483
+ category: 'Content',
484
+ description: 'Inserts a classic content area by its folder path and name.',
485
+ params: [
486
+ { name: 'name', description: 'Content area folder path and name', type: 'string' },
487
+ {
488
+ name: 'impressionRegion',
489
+ description: 'Impression region name',
490
+ type: 'string',
491
+ optional: true,
492
+ },
493
+ { name: 'layout', description: 'Layout option', type: 'string', optional: true },
494
+ { name: 'tag', description: 'Wrapping HTML tag', type: 'string', optional: true },
495
+ {
496
+ name: 'errorMessage',
497
+ description: 'Error message if not found',
498
+ type: 'string',
499
+ optional: true,
500
+ },
501
+ ],
502
+ returnType: 'string',
503
+ syntax: 'ContentAreaByName(name[, impressionRegion, layout, tag, errorMessage])',
504
+ },
505
+ {
506
+ name: 'ContentBlockByID',
507
+ minArgs: 1,
508
+ maxArgs: 5,
509
+ category: 'Content',
510
+ description: 'Retrieves and renders a Content Builder content block by its numeric ID.',
511
+ params: [
512
+ { name: 'id', description: 'Content block ID', type: 'number' },
513
+ {
514
+ name: 'impressionRegion',
515
+ description: 'Impression region name',
516
+ type: 'string',
517
+ optional: true,
518
+ },
519
+ {
520
+ name: 'throwError',
521
+ description: 'Return error if not found',
522
+ type: 'boolean',
523
+ optional: true,
524
+ },
525
+ {
526
+ name: 'defaultContent',
527
+ description: 'Fallback content if not found',
528
+ type: 'string',
529
+ optional: true,
530
+ },
531
+ {
532
+ name: 'templateBasedLayout',
533
+ description: 'Layout for template-based content',
534
+ type: 'string',
535
+ optional: true,
536
+ },
537
+ ],
538
+ returnType: 'string',
539
+ syntax: 'ContentBlockByID(id[, impressionRegion, throwError, defaultContent, templateBasedLayout])',
540
+ },
541
+ {
542
+ name: 'ContentBlockByKey',
543
+ minArgs: 1,
544
+ maxArgs: 5,
545
+ category: 'Content',
546
+ description: 'Retrieves and renders a Content Builder content block by its customer key.',
547
+ params: [
548
+ { name: 'customerKey', description: 'Content block customer key', type: 'string' },
549
+ {
550
+ name: 'impressionRegion',
551
+ description: 'Impression region name',
552
+ type: 'string',
553
+ optional: true,
554
+ },
555
+ {
556
+ name: 'throwError',
557
+ description: 'Return error if not found',
558
+ type: 'boolean',
559
+ optional: true,
560
+ },
561
+ {
562
+ name: 'defaultContent',
563
+ description: 'Fallback content if not found',
564
+ type: 'string',
565
+ optional: true,
566
+ },
567
+ {
568
+ name: 'templateBasedLayout',
569
+ description: 'Layout for template-based content',
570
+ type: 'string',
571
+ optional: true,
572
+ },
573
+ ],
574
+ returnType: 'string',
575
+ syntax: 'ContentBlockByKey(customerKey[, impressionRegion, throwError, defaultContent, templateBasedLayout])',
576
+ },
577
+ {
578
+ name: 'ContentBlockByName',
579
+ minArgs: 1,
580
+ maxArgs: 5,
581
+ category: 'Content',
582
+ description:
583
+ 'Retrieves and renders a Content Builder content block by its folder path and name.',
584
+ params: [
585
+ { name: 'name', description: 'Content block folder path and name', type: 'string' },
586
+ {
587
+ name: 'impressionRegion',
588
+ description: 'Impression region name',
589
+ type: 'string',
590
+ optional: true,
591
+ },
592
+ {
593
+ name: 'throwError',
594
+ description: 'Return error if not found',
595
+ type: 'boolean',
596
+ optional: true,
597
+ },
598
+ {
599
+ name: 'defaultContent',
600
+ description: 'Fallback content if not found',
601
+ type: 'string',
602
+ optional: true,
603
+ },
604
+ {
605
+ name: 'templateBasedLayout',
606
+ description: 'Layout for template-based content',
607
+ type: 'string',
608
+ optional: true,
609
+ },
610
+ ],
611
+ returnType: 'string',
612
+ syntax: 'ContentBlockByName(name[, impressionRegion, throwError, defaultContent, templateBasedLayout])',
613
+ },
614
+ {
615
+ name: 'ContentImageByID',
616
+ minArgs: 1,
617
+ maxArgs: 2,
618
+ category: 'Content',
619
+ description: 'Returns the URL of a Content Builder image asset by its numeric ID.',
620
+ params: [
621
+ { name: 'id', description: 'Image asset ID', type: 'number' },
622
+ {
623
+ name: 'altText',
624
+ description: 'Alt text for the image',
625
+ type: 'string',
626
+ optional: true,
627
+ },
628
+ ],
629
+ returnType: 'string',
630
+ syntax: 'ContentImageByID(id[, altText])',
631
+ },
632
+ {
633
+ name: 'ContentImageByKey',
634
+ minArgs: 1,
635
+ maxArgs: 2,
636
+ category: 'Content',
637
+ description: 'Returns the URL of a Content Builder image asset by its customer key.',
638
+ params: [
639
+ { name: 'customerKey', description: 'Image asset customer key', type: 'string' },
640
+ {
641
+ name: 'altText',
642
+ description: 'Alt text for the image',
643
+ type: 'string',
644
+ optional: true,
645
+ },
646
+ ],
647
+ returnType: 'string',
648
+ syntax: 'ContentImageByKey(customerKey[, altText])',
649
+ },
650
+ {
651
+ name: 'CreateMSCRMRecord',
652
+ minArgs: 3,
653
+ maxArgs: INF,
654
+ category: 'Microsoft Dynamics CRM',
655
+ description: 'Creates a new record in Microsoft Dynamics CRM.',
656
+ params: [
657
+ { name: 'entityType', description: 'CRM entity type name', type: 'string' },
658
+ { name: 'field1', description: 'First field name to set', type: 'string' },
659
+ { name: 'value1', description: 'First field value' },
660
+ {
661
+ name: 'fieldN',
662
+ description: 'Additional field name',
663
+ type: 'string',
664
+ optional: true,
665
+ },
666
+ { name: 'valueN', description: 'Additional field value', optional: true },
667
+ ],
668
+ returnType: 'string',
669
+ syntax: 'CreateMSCRMRecord(entityType, field1, value1[, fieldN, valueN, ...])',
670
+ },
671
+ {
672
+ name: 'CreateObject',
673
+ minArgs: 1,
674
+ maxArgs: 1,
675
+ category: 'Marketing Cloud API',
676
+ description:
677
+ 'Instantiates a Marketing Cloud SOAP API object for use with Invoke* functions.',
678
+ params: [{ name: 'objectTypeName', description: 'API object type name', type: 'string' }],
679
+ returnType: 'object',
680
+ syntax: 'CreateObject(objectTypeName)',
681
+ example: "%%=CreateObject('DataExtensionObject')=%%",
682
+ },
683
+ {
684
+ name: 'CreateSalesforceObject',
685
+ minArgs: 4,
686
+ maxArgs: INF,
687
+ category: 'Sales and Service Cloud',
688
+ description: 'Creates a new record in a connected Salesforce CRM object.',
689
+ params: [
690
+ { name: 'objectType', description: 'Salesforce object API name', type: 'string' },
691
+ { name: 'fieldCount', description: 'Number of field-value pairs', type: 'number' },
692
+ { name: 'field1', description: 'First field API name', type: 'string' },
693
+ { name: 'value1', description: 'First field value' },
694
+ {
695
+ name: 'fieldN',
696
+ description: 'Additional field API name',
697
+ type: 'string',
698
+ optional: true,
699
+ },
700
+ { name: 'valueN', description: 'Additional field value', optional: true },
701
+ ],
702
+ returnType: 'string',
703
+ syntax: 'CreateSalesforceObject(objectType, fieldCount, field1, value1[, fieldN, valueN, ...])',
704
+ },
705
+ {
706
+ name: 'CreateSmsConversation',
707
+ minArgs: 4,
708
+ maxArgs: 4,
709
+ category: 'MobileConnect',
710
+ description: 'Initiates an SMS conversation on a MobileConnect short code.',
711
+ params: [
712
+ { name: 'shortCode', description: 'SMS short code', type: 'string' },
713
+ { name: 'keyword', description: 'Current conversation keyword', type: 'string' },
714
+ { name: 'nextKeyword', description: 'Next expected keyword', type: 'string' },
715
+ { name: 'messageText', description: 'Message to send', type: 'string' },
716
+ ],
717
+ returnType: 'void',
718
+ syntax: 'CreateSmsConversation(shortCode, keyword, nextKeyword, messageText)',
719
+ },
720
+ {
721
+ name: 'DataExtensionRowCount',
722
+ minArgs: 1,
723
+ maxArgs: 1,
724
+ category: 'Data Extension',
725
+ description: 'Returns the total number of rows in a data extension.',
726
+ params: [
727
+ {
728
+ name: 'dataExtensionName',
729
+ description: 'Data extension name or external key',
730
+ type: 'string',
731
+ },
732
+ ],
733
+ returnType: 'number',
734
+ syntax: 'DataExtensionRowCount(dataExtensionName)',
735
+ example: "%%=DataExtensionRowCount('MyDE')=%%",
736
+ },
737
+ {
738
+ name: 'DateAdd',
739
+ minArgs: 3,
740
+ maxArgs: 3,
741
+ category: 'Date and Time',
742
+ description: 'Adds a specified interval to a date value.',
743
+ params: [
744
+ { name: 'date', description: 'Base date', type: 'date' },
745
+ { name: 'number', description: 'Number of intervals to add', type: 'number' },
746
+ { name: 'datePart', description: 'Interval type (Y, M, D, H, MI)', type: 'string' },
747
+ ],
748
+ returnType: 'date',
749
+ syntax: 'DateAdd(date, number, datePart)',
750
+ example: "%%=DateAdd(Now(), 7, 'D')=%%",
751
+ },
752
+ {
753
+ name: 'DateDiff',
754
+ minArgs: 3,
755
+ maxArgs: 3,
756
+ category: 'Date and Time',
757
+ description: 'Returns the difference between two dates in the specified interval.',
758
+ params: [
759
+ { name: 'date1', description: 'Start date', type: 'date' },
760
+ { name: 'date2', description: 'End date', type: 'date' },
761
+ { name: 'datePart', description: 'Interval type (Y, M, D, H, MI)', type: 'string' },
762
+ ],
763
+ returnType: 'number',
764
+ syntax: 'DateDiff(date1, date2, datePart)',
765
+ },
766
+ {
767
+ name: 'DateParse',
768
+ minArgs: 1,
769
+ maxArgs: 2,
770
+ category: 'Date and Time',
771
+ description: 'Parses a date string into a date value.',
772
+ params: [
773
+ { name: 'dateString', description: 'String to parse as a date', type: 'string' },
774
+ {
775
+ name: 'convertToLocal',
776
+ description: 'Convert to local time zone',
777
+ type: 'boolean',
778
+ optional: true,
779
+ },
780
+ ],
781
+ returnType: 'date',
782
+ syntax: 'DateParse(dateString[, convertToLocal])',
783
+ },
784
+ {
785
+ name: 'DatePart',
786
+ minArgs: 2,
787
+ maxArgs: 2,
788
+ category: 'Date and Time',
789
+ description: 'Extracts a specific component from a date value.',
790
+ params: [
791
+ { name: 'date', description: 'Date to extract from', type: 'date' },
792
+ {
793
+ name: 'datePart',
794
+ description: 'Part to extract (Y, M, D, H, MI, DOW)',
795
+ type: 'string',
796
+ },
797
+ ],
798
+ returnType: 'number',
799
+ syntax: 'DatePart(date, datePart)',
800
+ },
801
+ {
802
+ name: 'DecryptSymmetric',
803
+ minArgs: 8,
804
+ maxArgs: 8,
805
+ category: 'Encryption and Encoding',
806
+ description: 'Decrypts a value using symmetric key encryption.',
807
+ params: [
808
+ { name: 'encryptedValue', description: 'Value to decrypt', type: 'string' },
809
+ { name: 'algorithm', description: 'Encryption algorithm (e.g. AES)', type: 'string' },
810
+ {
811
+ name: 'passwordExternalKey',
812
+ description: 'External key for the password',
813
+ type: 'string',
814
+ },
815
+ {
816
+ name: 'password',
817
+ description: 'Password value or empty to use external key',
818
+ type: 'string',
819
+ },
820
+ { name: 'saltExternalKey', description: 'External key for the salt', type: 'string' },
821
+ {
822
+ name: 'salt',
823
+ description: 'Salt value or empty to use external key',
824
+ type: 'string',
825
+ },
826
+ {
827
+ name: 'ivExternalKey',
828
+ description: 'External key for the initialization vector',
829
+ type: 'string',
830
+ },
831
+ { name: 'iv', description: 'IV value or empty to use external key', type: 'string' },
832
+ ],
833
+ returnType: 'string',
834
+ syntax: 'DecryptSymmetric(encryptedValue, algorithm, passwordExternalKey, password, saltExternalKey, salt, ivExternalKey, iv)',
835
+ },
836
+ {
837
+ name: 'DeleteData',
838
+ minArgs: 3,
839
+ maxArgs: INF,
840
+ category: 'Data Extension',
841
+ description:
842
+ 'Deletes rows from a data extension matching the specified key column criteria.',
843
+ params: [
844
+ { name: 'dataExtensionName', description: 'Target data extension', type: 'string' },
845
+ { name: 'column1', description: 'First filter column name', type: 'string' },
846
+ { name: 'value1', description: 'First filter column value' },
847
+ {
848
+ name: 'columnN',
849
+ description: 'Additional filter column name',
850
+ type: 'string',
851
+ optional: true,
852
+ },
853
+ { name: 'valueN', description: 'Additional filter value', optional: true },
854
+ ],
855
+ returnType: 'number',
856
+ syntax: 'DeleteData(dataExtensionName, column1, value1[, columnN, valueN, ...])',
857
+ },
858
+ {
859
+ name: 'DeleteDE',
860
+ minArgs: 3,
861
+ maxArgs: INF,
862
+ category: 'Data Extension',
863
+ description: 'Legacy alias for DeleteData. Deletes rows from a data extension.',
864
+ params: [
865
+ { name: 'dataExtensionName', description: 'Target data extension', type: 'string' },
866
+ { name: 'column1', description: 'First filter column name', type: 'string' },
867
+ { name: 'value1', description: 'First filter column value' },
868
+ {
869
+ name: 'columnN',
870
+ description: 'Additional filter column name',
871
+ type: 'string',
872
+ optional: true,
873
+ },
874
+ { name: 'valueN', description: 'Additional filter value', optional: true },
875
+ ],
876
+ returnType: 'number',
877
+ syntax: 'DeleteDE(dataExtensionName, column1, value1[, columnN, valueN, ...])',
878
+ },
879
+ {
880
+ name: 'DescribeMSCRMEntities',
881
+ minArgs: 0,
882
+ maxArgs: 0,
883
+ category: 'Microsoft Dynamics CRM',
884
+ description: 'Returns a rowset describing all available Dynamics CRM entity types.',
885
+ params: [],
886
+ returnType: 'rowset',
887
+ syntax: 'DescribeMSCRMEntities()',
888
+ },
889
+ {
890
+ name: 'DescribeMSCRMEntityAttributes',
891
+ minArgs: 1,
892
+ maxArgs: 1,
893
+ category: 'Microsoft Dynamics CRM',
894
+ description: 'Returns a rowset of attributes for the specified CRM entity type.',
895
+ params: [{ name: 'entityType', description: 'CRM entity type name', type: 'string' }],
896
+ returnType: 'rowset',
897
+ syntax: 'DescribeMSCRMEntityAttributes(entityType)',
898
+ },
899
+ {
900
+ name: 'Divide',
901
+ minArgs: 2,
902
+ maxArgs: 2,
903
+ category: 'Math',
904
+ description: 'Divides the first number by the second.',
905
+ params: [
906
+ { name: 'dividend', description: 'Number to divide', type: 'number' },
907
+ { name: 'divisor', description: 'Number to divide by', type: 'number' },
908
+ ],
909
+ returnType: 'number',
910
+ syntax: 'Divide(dividend, divisor)',
911
+ example: '%%=Divide(100, 4)=%%',
912
+ },
913
+ {
914
+ name: 'Domain',
915
+ minArgs: 1,
916
+ maxArgs: 1,
917
+ category: 'Utility',
918
+ description: 'Extracts the domain portion from an email address.',
919
+ params: [{ name: 'emailAddress', description: 'Email address', type: 'string' }],
920
+ returnType: 'string',
921
+ syntax: 'Domain(emailAddress)',
922
+ example: "%%=Domain('user@example.com')=%%",
923
+ },
924
+ {
925
+ name: 'Empty',
926
+ minArgs: 1,
927
+ maxArgs: 1,
928
+ category: 'Utility',
929
+ description: 'Returns true if the value is empty, null, or not defined.',
930
+ params: [{ name: 'value', description: 'Value to test' }],
931
+ returnType: 'boolean',
932
+ syntax: 'Empty(value)',
933
+ example: '%%=Empty(@myVar)=%%',
934
+ },
935
+ {
936
+ name: 'EncryptSymmetric',
937
+ minArgs: 8,
938
+ maxArgs: 8,
939
+ category: 'Encryption and Encoding',
940
+ description: 'Encrypts a value using symmetric key encryption.',
941
+ params: [
942
+ { name: 'value', description: 'Value to encrypt', type: 'string' },
943
+ { name: 'algorithm', description: 'Encryption algorithm (e.g. AES)', type: 'string' },
944
+ {
945
+ name: 'passwordExternalKey',
946
+ description: 'External key for the password',
947
+ type: 'string',
948
+ },
949
+ {
950
+ name: 'password',
951
+ description: 'Password value or empty to use external key',
952
+ type: 'string',
953
+ },
954
+ { name: 'saltExternalKey', description: 'External key for the salt', type: 'string' },
955
+ {
956
+ name: 'salt',
957
+ description: 'Salt value or empty to use external key',
958
+ type: 'string',
959
+ },
960
+ {
961
+ name: 'ivExternalKey',
962
+ description: 'External key for the initialization vector',
963
+ type: 'string',
964
+ },
965
+ { name: 'iv', description: 'IV value or empty to use external key', type: 'string' },
966
+ ],
967
+ returnType: 'string',
968
+ syntax: 'EncryptSymmetric(value, algorithm, passwordExternalKey, password, saltExternalKey, salt, ivExternalKey, iv)',
969
+ },
970
+ {
971
+ name: 'EndImpressionRegion',
972
+ minArgs: 0,
973
+ maxArgs: 1,
974
+ category: 'Content',
975
+ description: 'Marks the end of an impression tracking region.',
976
+ params: [
977
+ {
978
+ name: 'trackImpression',
979
+ description: 'Whether to track the impression',
980
+ type: 'boolean',
981
+ optional: true,
982
+ },
983
+ ],
984
+ returnType: 'void',
985
+ syntax: 'EndImpressionRegion([trackImpression])',
986
+ },
987
+ {
988
+ name: 'EndSmsConversation',
989
+ minArgs: 2,
990
+ maxArgs: 2,
991
+ category: 'MobileConnect',
992
+ description: 'Ends an active SMS conversation on a short code.',
993
+ params: [
994
+ { name: 'shortCode', description: 'SMS short code', type: 'string' },
995
+ { name: 'keyword', description: 'Conversation keyword to end', type: 'string' },
996
+ ],
997
+ returnType: 'void',
998
+ syntax: 'EndSmsConversation(shortCode, keyword)',
999
+ },
1000
+ {
1001
+ name: 'ExecuteFilter',
1002
+ minArgs: 1,
1003
+ maxArgs: 1,
1004
+ category: 'Data Extension',
1005
+ description: 'Executes a predefined data filter and returns the resulting rowset.',
1006
+ params: [{ name: 'filterName', description: 'Name of the saved filter', type: 'string' }],
1007
+ returnType: 'rowset',
1008
+ syntax: 'ExecuteFilter(filterName)',
1009
+ },
1010
+ {
1011
+ name: 'ExecuteFilterOrderedRows',
1012
+ minArgs: 3,
1013
+ maxArgs: 3,
1014
+ category: 'Data Extension',
1015
+ description: 'Executes a predefined data filter and returns results sorted by a column.',
1016
+ params: [
1017
+ { name: 'filterName', description: 'Name of the saved filter', type: 'string' },
1018
+ { name: 'sortColumn', description: 'Column to sort by', type: 'string' },
1019
+ { name: 'sortDirection', description: 'Sort direction (ASC or DESC)', type: 'string' },
1020
+ ],
1021
+ returnType: 'rowset',
1022
+ syntax: 'ExecuteFilterOrderedRows(filterName, sortColumn, sortDirection)',
1023
+ },
1024
+ {
1025
+ name: 'Field',
1026
+ minArgs: 2,
1027
+ maxArgs: 3,
1028
+ category: 'Data Extension',
1029
+ description: 'Retrieves the value of a specific field from a rowset row.',
1030
+ params: [
1031
+ { name: 'row', description: 'Row object from a rowset' },
1032
+ { name: 'fieldName', description: 'Column name to retrieve', type: 'string' },
1033
+ {
1034
+ name: 'ordinal',
1035
+ description: 'Column ordinal (0-based)',
1036
+ type: 'number',
1037
+ optional: true,
1038
+ },
1039
+ ],
1040
+ returnType: 'string',
1041
+ syntax: 'Field(row, fieldName[, ordinal])',
1042
+ example: "%%=Field(Row(@rows, 1), 'Name')=%%",
1043
+ },
1044
+ {
1045
+ name: 'Format',
1046
+ minArgs: 2,
1047
+ maxArgs: 4,
1048
+ category: 'Utility',
1049
+ description: 'Formats a value using a .NET format string.',
1050
+ params: [
1051
+ { name: 'value', description: 'Value to format' },
1052
+ { name: 'formatString', description: '.NET format string', type: 'string' },
1053
+ {
1054
+ name: 'culture',
1055
+ description: 'Culture code (e.g. en-US)',
1056
+ type: 'string',
1057
+ optional: true,
1058
+ },
1059
+ { name: 'timeZone', description: 'Target time zone', type: 'string', optional: true },
1060
+ ],
1061
+ returnType: 'string',
1062
+ syntax: 'Format(value, formatString[, culture, timeZone])',
1063
+ },
1064
+ {
1065
+ name: 'FormatCurrency',
1066
+ minArgs: 2,
1067
+ maxArgs: 4,
1068
+ category: 'Utility',
1069
+ description: 'Formats a number as a currency string.',
1070
+ params: [
1071
+ { name: 'value', description: 'Numeric value', type: 'number' },
1072
+ { name: 'locale', description: 'Locale code (e.g. en-US)', type: 'string' },
1073
+ {
1074
+ name: 'decimalPlaces',
1075
+ description: 'Number of decimal places',
1076
+ type: 'number',
1077
+ optional: true,
1078
+ },
1079
+ {
1080
+ name: 'symbol',
1081
+ description: 'Custom currency symbol',
1082
+ type: 'string',
1083
+ optional: true,
1084
+ },
1085
+ ],
1086
+ returnType: 'string',
1087
+ syntax: 'FormatCurrency(value, locale[, decimalPlaces, symbol])',
1088
+ },
1089
+ {
1090
+ name: 'FormatDate',
1091
+ minArgs: 2,
1092
+ maxArgs: 4,
1093
+ category: 'Date and Time',
1094
+ description: 'Formats a date value according to the specified format pattern.',
1095
+ params: [
1096
+ { name: 'date', description: 'Date to format', type: 'date' },
1097
+ {
1098
+ name: 'format',
1099
+ description: 'Format type or pattern (s, l, iso, custom)',
1100
+ type: 'string',
1101
+ },
1102
+ { name: 'locale', description: 'Locale code', type: 'string', optional: true },
1103
+ { name: 'timeZone', description: 'Target time zone', type: 'string', optional: true },
1104
+ ],
1105
+ returnType: 'string',
1106
+ syntax: 'FormatDate(date, format[, locale, timeZone])',
1107
+ example: "%%=FormatDate(Now(), 'iso')=%%",
1108
+ },
1109
+ {
1110
+ name: 'FormatNumber',
1111
+ minArgs: 2,
1112
+ maxArgs: 3,
1113
+ category: 'Utility',
1114
+ description: 'Formats a number using a format pattern.',
1115
+ params: [
1116
+ { name: 'number', description: 'Numeric value to format', type: 'number' },
1117
+ { name: 'format', description: 'Format pattern (e.g. N2, C0)', type: 'string' },
1118
+ { name: 'locale', description: 'Locale code', type: 'string', optional: true },
1119
+ ],
1120
+ returnType: 'string',
1121
+ syntax: 'FormatNumber(number, format[, locale])',
1122
+ },
1123
+ {
1124
+ name: 'GetJWT',
1125
+ minArgs: 3,
1126
+ maxArgs: 3,
1127
+ category: 'Encryption and Encoding',
1128
+ description: 'Generates a JSON Web Token using the supplied claims, algorithm, and secret.',
1129
+ params: [
1130
+ { name: 'claimsSet', description: 'JSON claims payload', type: 'string' },
1131
+ { name: 'algorithm', description: 'Signing algorithm (e.g. HS256)', type: 'string' },
1132
+ { name: 'secret', description: 'Secret key for signing', type: 'string' },
1133
+ ],
1134
+ returnType: 'string',
1135
+ syntax: 'GetJWT(claimsSet, algorithm, secret)',
1136
+ },
1137
+ {
1138
+ name: 'GetJWTByKeyName',
1139
+ minArgs: 3,
1140
+ maxArgs: 3,
1141
+ category: 'Encryption and Encoding',
1142
+ description: 'Generates a JSON Web Token using a named encryption key from Key Management.',
1143
+ params: [
1144
+ { name: 'claimsSet', description: 'JSON claims payload', type: 'string' },
1145
+ { name: 'algorithm', description: 'Signing algorithm', type: 'string' },
1146
+ { name: 'keyName', description: 'Key Management key external key', type: 'string' },
1147
+ ],
1148
+ returnType: 'string',
1149
+ syntax: 'GetJWTByKeyName(claimsSet, algorithm, keyName)',
1150
+ },
1151
+ {
1152
+ name: 'GetPortfolioItem',
1153
+ minArgs: 1,
1154
+ maxArgs: 1,
1155
+ category: 'Content',
1156
+ description: 'Retrieves metadata for a classic portfolio item.',
1157
+ params: [{ name: 'portfolioId', description: 'Portfolio item ID', type: 'number' }],
1158
+ returnType: 'string',
1159
+ syntax: 'GetPortfolioItem(portfolioId)',
1160
+ },
1161
+ {
1162
+ name: 'GetPublishedSocialContent',
1163
+ minArgs: 1,
1164
+ maxArgs: 1,
1165
+ category: 'Social',
1166
+ description: 'Retrieves published social media content by its identifier.',
1167
+ params: [{ name: 'socialContentId', description: 'Social content ID', type: 'string' }],
1168
+ returnType: 'string',
1169
+ syntax: 'GetPublishedSocialContent(socialContentId)',
1170
+ },
1171
+ {
1172
+ name: 'GetSendTime',
1173
+ minArgs: 0,
1174
+ maxArgs: 1,
1175
+ category: 'Date and Time',
1176
+ description:
1177
+ 'Returns the scheduled send time for the current job. In STO context returns the Einstein-optimized time.',
1178
+ params: [
1179
+ {
1180
+ name: 'persistFormat',
1181
+ description: 'Persist date format flag',
1182
+ type: 'boolean',
1183
+ optional: true,
1184
+ },
1185
+ ],
1186
+ returnType: 'date',
1187
+ syntax: 'GetSendTime([persistFormat])',
1188
+ },
1189
+ {
1190
+ name: 'GetSocialPublishURL',
1191
+ minArgs: 2,
1192
+ maxArgs: INF,
1193
+ category: 'Social',
1194
+ description: 'Returns the social publish URL for a specified region and account.',
1195
+ params: [
1196
+ { name: 'regionId', description: 'Social region ID', type: 'string' },
1197
+ { name: 'socialAccount', description: 'Social account identifier', type: 'string' },
1198
+ ],
1199
+ returnType: 'string',
1200
+ syntax: 'GetSocialPublishURL(regionId, socialAccount[, ...])',
1201
+ },
1202
+ {
1203
+ name: 'GetSocialPublishURLByName',
1204
+ minArgs: 2,
1205
+ maxArgs: INF,
1206
+ category: 'Social',
1207
+ description: 'Returns the social publish URL for a specified region name and account.',
1208
+ params: [
1209
+ { name: 'regionName', description: 'Social region name', type: 'string' },
1210
+ { name: 'socialAccount', description: 'Social account identifier', type: 'string' },
1211
+ ],
1212
+ returnType: 'string',
1213
+ syntax: 'GetSocialPublishURLByName(regionName, socialAccount[, ...])',
1214
+ },
1215
+ {
1216
+ name: 'GetValue',
1217
+ minArgs: 1,
1218
+ maxArgs: 1,
1219
+ category: 'Utility',
1220
+ description: 'Returns the value of a variable by name at runtime.',
1221
+ params: [
1222
+ {
1223
+ name: 'variableName',
1224
+ description: 'Name of the variable (without @)',
1225
+ type: 'string',
1226
+ },
1227
+ ],
1228
+ returnType: 'string',
1229
+ syntax: 'GetValue(variableName)',
1230
+ },
1231
+ {
1232
+ name: 'GUID',
1233
+ minArgs: 0,
1234
+ maxArgs: 0,
1235
+ category: 'Utility',
1236
+ description: 'Generates a new globally unique identifier (GUID).',
1237
+ params: [],
1238
+ returnType: 'string',
1239
+ syntax: 'GUID()',
1240
+ example: '%%=GUID()=%%',
1241
+ },
1242
+ {
1243
+ name: 'HTTPGet',
1244
+ minArgs: 1,
1245
+ maxArgs: 4,
1246
+ category: 'HTTP',
1247
+ description: 'Performs an HTTP GET request and returns the response body.',
1248
+ params: [
1249
+ { name: 'url', description: 'Request URL', type: 'string' },
1250
+ {
1251
+ name: 'continueOnError',
1252
+ description: 'Continue on error (true/false)',
1253
+ type: 'boolean',
1254
+ optional: true,
1255
+ },
1256
+ {
1257
+ name: 'headerName',
1258
+ description: 'Request header name',
1259
+ type: 'string',
1260
+ optional: true,
1261
+ },
1262
+ {
1263
+ name: 'headerValue',
1264
+ description: 'Request header value',
1265
+ type: 'string',
1266
+ optional: true,
1267
+ },
1268
+ ],
1269
+ returnType: 'string',
1270
+ syntax: 'HTTPGet(url[, continueOnError, headerName, headerValue])',
1271
+ example: "%%=HTTPGet('https://example.com/api')=%%",
1272
+ },
1273
+ {
1274
+ name: 'HTTPPost',
1275
+ minArgs: 3,
1276
+ maxArgs: INF,
1277
+ category: 'HTTP',
1278
+ description:
1279
+ 'Performs an HTTP POST request. The response body is stored in the output variable.',
1280
+ params: [
1281
+ { name: 'url', description: 'Request URL', type: 'string' },
1282
+ { name: 'contentType', description: 'Content-Type header', type: 'string' },
1283
+ { name: 'payload', description: 'Request body', type: 'string' },
1284
+ {
1285
+ name: 'response',
1286
+ description: 'Output variable for response body (pass @variable)',
1287
+ type: 'string',
1288
+ optional: true,
1289
+ },
1290
+ {
1291
+ name: 'headerName',
1292
+ description: 'Request header name',
1293
+ type: 'string',
1294
+ optional: true,
1295
+ },
1296
+ {
1297
+ name: 'headerValue',
1298
+ description: 'Request header value',
1299
+ type: 'string',
1300
+ optional: true,
1301
+ },
1302
+ ],
1303
+ returnType: 'number',
1304
+ syntax: 'HTTPPost(url, contentType, payload[, @response, headerName, headerValue, ...])',
1305
+ },
1306
+ {
1307
+ name: 'HTTPPost2',
1308
+ minArgs: 7,
1309
+ maxArgs: INF,
1310
+ category: 'HTTP',
1311
+ description:
1312
+ 'Performs an HTTP POST with access to response headers. Response body and headers stored in output variables.',
1313
+ params: [
1314
+ { name: 'url', description: 'Request URL', type: 'string' },
1315
+ { name: 'contentType', description: 'Content-Type header', type: 'string' },
1316
+ { name: 'payload', description: 'Request body', type: 'string' },
1317
+ { name: 'response', description: 'Output variable for response body', type: 'string' },
1318
+ {
1319
+ name: 'responseHeaders',
1320
+ description: 'Output variable for response headers',
1321
+ type: 'string',
1322
+ },
1323
+ { name: 'headerName1', description: 'First request header name', type: 'string' },
1324
+ { name: 'headerValue1', description: 'First request header value', type: 'string' },
1325
+ ],
1326
+ returnType: 'number',
1327
+ syntax: 'HTTPPost2(url, contentType, payload, @response, @responseHeaders, headerName1, headerValue1[, ...])',
1328
+ },
1329
+ {
1330
+ name: 'HTTPPostWithRetry',
1331
+ minArgs: 7,
1332
+ maxArgs: INF,
1333
+ category: 'HTTP',
1334
+ description: 'Performs an HTTP POST with automatic retry logic on failure.',
1335
+ params: [
1336
+ { name: 'url', description: 'Request URL', type: 'string' },
1337
+ { name: 'contentType', description: 'Content-Type header', type: 'string' },
1338
+ { name: 'payload', description: 'Request body', type: 'string' },
1339
+ { name: 'response', description: 'Output variable for response body', type: 'string' },
1340
+ {
1341
+ name: 'responseHeaders',
1342
+ description: 'Output variable for response headers',
1343
+ type: 'string',
1344
+ },
1345
+ { name: 'maxRetries', description: 'Maximum number of retry attempts', type: 'number' },
1346
+ {
1347
+ name: 'retryDelay',
1348
+ description: 'Delay between retries in milliseconds',
1349
+ type: 'number',
1350
+ },
1351
+ ],
1352
+ returnType: 'number',
1353
+ syntax: 'HTTPPostWithRetry(url, contentType, payload, @response, @responseHeaders, maxRetries, retryDelay[, ...])',
1354
+ },
1355
+ {
1356
+ name: 'HTTPRequestHeader',
1357
+ minArgs: 1,
1358
+ maxArgs: 1,
1359
+ category: 'HTTP',
1360
+ description:
1361
+ 'Returns the value of a specified HTTP request header from the inbound request.',
1362
+ params: [{ name: 'headerName', description: 'HTTP header name', type: 'string' }],
1363
+ returnType: 'string',
1364
+ syntax: 'HTTPRequestHeader(headerName)',
1365
+ example: "%%=HTTPRequestHeader('X-Forwarded-For')=%%",
1366
+ },
1367
+ {
1368
+ name: 'IIf',
1369
+ minArgs: 3,
1370
+ maxArgs: 3,
1371
+ category: 'Utility',
1372
+ description: 'Returns one of two values based on a boolean expression (inline if).',
1373
+ params: [
1374
+ { name: 'expression', description: 'Boolean expression to evaluate', type: 'boolean' },
1375
+ { name: 'trueValue', description: 'Value returned when true' },
1376
+ { name: 'falseValue', description: 'Value returned when false' },
1377
+ ],
1378
+ returnType: 'string',
1379
+ syntax: 'IIf(expression, trueValue, falseValue)',
1380
+ example: "%%=IIf(Empty(@name), 'Friend', @name)=%%",
1381
+ },
1382
+ {
1383
+ name: 'Image',
1384
+ minArgs: 2,
1385
+ maxArgs: 2,
1386
+ category: 'Content',
1387
+ description: 'Returns an HTML img tag for the Portfolio image matching the specified customer key.',
1388
+ params: [
1389
+ { name: 'customerKey', description: 'Customer/external key of the image', type: 'string' },
1390
+ { name: 'fallbackKey', description: 'Customer/external key of the fallback image if the primary is not found', type: 'string' },
1391
+ ],
1392
+ returnType: 'string',
1393
+ syntax: 'Image(customerKey, fallbackKey)',
1394
+ },
1395
+ {
1396
+ name: 'IndexOf',
1397
+ minArgs: 2,
1398
+ maxArgs: 2,
1399
+ category: 'String',
1400
+ description: 'Returns the 1-based position of the first occurrence of a substring.',
1401
+ params: [
1402
+ { name: 'string', description: 'String to search in', type: 'string' },
1403
+ { name: 'substring', description: 'Substring to find', type: 'string' },
1404
+ ],
1405
+ returnType: 'number',
1406
+ syntax: 'IndexOf(string, substring)',
1407
+ example: "%%=IndexOf('Hello World', 'World')=%%",
1408
+ },
1409
+ {
1410
+ name: 'InsertData',
1411
+ minArgs: 3,
1412
+ maxArgs: INF,
1413
+ category: 'Data Extension',
1414
+ description: 'Inserts a new row into a data extension.',
1415
+ params: [
1416
+ { name: 'dataExtensionName', description: 'Target data extension', type: 'string' },
1417
+ { name: 'column1', description: 'First column name', type: 'string' },
1418
+ { name: 'value1', description: 'First column value' },
1419
+ {
1420
+ name: 'columnN',
1421
+ description: 'Additional column name',
1422
+ type: 'string',
1423
+ optional: true,
1424
+ },
1425
+ { name: 'valueN', description: 'Additional column value', optional: true },
1426
+ ],
1427
+ returnType: 'number',
1428
+ syntax: 'InsertData(dataExtensionName, column1, value1[, columnN, valueN, ...])',
1429
+ },
1430
+ {
1431
+ name: 'InsertDE',
1432
+ minArgs: 3,
1433
+ maxArgs: INF,
1434
+ category: 'Data Extension',
1435
+ description: 'Legacy alias for InsertData. Inserts a new row into a data extension.',
1436
+ params: [
1437
+ { name: 'dataExtensionName', description: 'Target data extension', type: 'string' },
1438
+ { name: 'column1', description: 'First column name', type: 'string' },
1439
+ { name: 'value1', description: 'First column value' },
1440
+ {
1441
+ name: 'columnN',
1442
+ description: 'Additional column name',
1443
+ type: 'string',
1444
+ optional: true,
1445
+ },
1446
+ { name: 'valueN', description: 'Additional column value', optional: true },
1447
+ ],
1448
+ returnType: 'number',
1449
+ syntax: 'InsertDE(dataExtensionName, column1, value1[, columnN, valueN, ...])',
1450
+ },
1451
+ {
1452
+ name: 'InvokeCreate',
1453
+ minArgs: 3,
1454
+ maxArgs: 4,
1455
+ category: 'Marketing Cloud API',
1456
+ description: 'Calls the SOAP API Create method on the given API object.',
1457
+ params: [
1458
+ { name: 'apiObject', description: 'API object to create' },
1459
+ {
1460
+ name: 'statusMessage',
1461
+ description: 'Output variable for the resulting status message',
1462
+ type: 'string',
1463
+ },
1464
+ { name: 'errorCode', description: 'Output variable for the resulting error code', type: 'string' },
1465
+ {
1466
+ name: 'createOptions',
1467
+ description: 'Optional CreateOptions API object',
1468
+ optional: true,
1469
+ },
1470
+ ],
1471
+ returnType: 'string',
1472
+ syntax: 'InvokeCreate(apiObject, @statusMessage, @errorCode[, createOptions])',
1473
+ },
1474
+ {
1475
+ name: 'InvokeDelete',
1476
+ minArgs: 3,
1477
+ maxArgs: 4,
1478
+ category: 'Marketing Cloud API',
1479
+ description: 'Calls the SOAP API Delete method on the given API object.',
1480
+ params: [
1481
+ { name: 'apiObject', description: 'API object to delete' },
1482
+ {
1483
+ name: 'statusMessage',
1484
+ description: 'Output variable for the resulting status message',
1485
+ type: 'string',
1486
+ },
1487
+ { name: 'errorCode', description: 'Output variable for the resulting error code', type: 'string' },
1488
+ {
1489
+ name: 'deleteOptions',
1490
+ description: 'Optional DeleteOptions API object',
1491
+ optional: true,
1492
+ },
1493
+ ],
1494
+ returnType: 'string',
1495
+ syntax: 'InvokeDelete(apiObject, @statusMessage, @errorCode[, deleteOptions])',
1496
+ },
1497
+ {
1498
+ name: 'InvokeExecute',
1499
+ minArgs: 3,
1500
+ maxArgs: 3,
1501
+ category: 'Marketing Cloud API',
1502
+ description: 'Calls the SOAP API Execute method on the given API object.',
1503
+ params: [
1504
+ { name: 'apiObject', description: 'API object to execute' },
1505
+ {
1506
+ name: 'statusMessage',
1507
+ description: 'Output variable for status message',
1508
+ type: 'string',
1509
+ },
1510
+ { name: 'errorCode', description: 'Output variable for error code', type: 'string' },
1511
+ ],
1512
+ returnType: 'string',
1513
+ syntax: 'InvokeExecute(apiObject, @statusMessage, @errorCode)',
1514
+ },
1515
+ {
1516
+ name: 'InvokePerform',
1517
+ minArgs: 2,
1518
+ maxArgs: 3,
1519
+ category: 'Marketing Cloud API',
1520
+ description: 'Calls the SOAP API Perform method on the given API object.',
1521
+ params: [
1522
+ { name: 'apiObject', description: 'API object to perform on' },
1523
+ { name: 'action', description: 'Action to perform (e.g. start, stop)', type: 'string' },
1524
+ {
1525
+ name: 'statusMessage',
1526
+ description: 'Output variable for the resulting status message',
1527
+ type: 'string',
1528
+ optional: true,
1529
+ },
1530
+ ],
1531
+ returnType: 'string',
1532
+ syntax: 'InvokePerform(apiObject, action[, @statusMessage])',
1533
+ },
1534
+ {
1535
+ name: 'InvokeRetrieve',
1536
+ minArgs: 1,
1537
+ maxArgs: 3,
1538
+ category: 'Marketing Cloud API',
1539
+ description: 'Calls the SOAP API Retrieve method and returns a rowset of results.',
1540
+ params: [
1541
+ { name: 'apiObject', description: 'API object defining the retrieve filter' },
1542
+ {
1543
+ name: 'statusMessage',
1544
+ description: 'Output variable for the resulting status message',
1545
+ type: 'string',
1546
+ optional: true,
1547
+ },
1548
+ {
1549
+ name: 'requestId',
1550
+ description: 'Output variable for the resulting RequestID',
1551
+ type: 'string',
1552
+ optional: true,
1553
+ },
1554
+ ],
1555
+ returnType: 'rowset',
1556
+ syntax: 'InvokeRetrieve(apiObject[, @statusMessage, @requestId])',
1557
+ },
1558
+ {
1559
+ name: 'InvokeUpdate',
1560
+ minArgs: 1,
1561
+ maxArgs: 4,
1562
+ category: 'Marketing Cloud API',
1563
+ description: 'Calls the SOAP API Update method on the given API object.',
1564
+ params: [
1565
+ { name: 'apiObject', description: 'API object to update' },
1566
+ {
1567
+ name: 'statusMessage',
1568
+ description: 'Output variable for the resulting status message',
1569
+ type: 'string',
1570
+ optional: true,
1571
+ },
1572
+ {
1573
+ name: 'errorCode',
1574
+ description: 'Output variable for the resulting error code',
1575
+ type: 'string',
1576
+ optional: true,
1577
+ },
1578
+ {
1579
+ name: 'updateOptions',
1580
+ description: 'Optional UpdateOptions API object',
1581
+ optional: true,
1582
+ },
1583
+ ],
1584
+ returnType: 'string',
1585
+ syntax: 'InvokeUpdate(apiObject[, @statusMessage, @errorCode, updateOptions])',
1586
+ },
1587
+ {
1588
+ name: 'IsCHTMLBrowser',
1589
+ minArgs: 1,
1590
+ maxArgs: 1,
1591
+ category: 'Utility',
1592
+ description:
1593
+ "Returns true if the subscriber's browser is identified as a compact HTML (cHTML) device.",
1594
+ params: [{ name: 'userAgent', description: 'User agent string to test', type: 'string' }],
1595
+ returnType: 'boolean',
1596
+ syntax: 'IsCHTMLBrowser(userAgent)',
1597
+ },
1598
+ {
1599
+ name: 'IsEmailAddress',
1600
+ minArgs: 1,
1601
+ maxArgs: 1,
1602
+ category: 'Utility',
1603
+ description: 'Returns true if the value is a syntactically valid email address.',
1604
+ params: [{ name: 'value', description: 'Value to validate', type: 'string' }],
1605
+ returnType: 'boolean',
1606
+ syntax: 'IsEmailAddress(value)',
1607
+ example: "%%=IsEmailAddress('test@example.com')=%%",
1608
+ },
1609
+ {
1610
+ name: 'IsNull',
1611
+ minArgs: 1,
1612
+ maxArgs: 1,
1613
+ category: 'Utility',
1614
+ description: 'Returns true if the value is null.',
1615
+ params: [{ name: 'value', description: 'Value to test' }],
1616
+ returnType: 'boolean',
1617
+ syntax: 'IsNull(value)',
1618
+ },
1619
+ {
1620
+ name: 'IsNullDefault',
1621
+ minArgs: 2,
1622
+ maxArgs: 2,
1623
+ category: 'Utility',
1624
+ description: 'Returns the value if not null, otherwise returns the default.',
1625
+ params: [
1626
+ { name: 'value', description: 'Value to test' },
1627
+ { name: 'defaultValue', description: 'Default to return when null' },
1628
+ ],
1629
+ returnType: 'string',
1630
+ syntax: 'IsNullDefault(value, defaultValue)',
1631
+ example: "%%=IsNullDefault(@name, 'Friend')=%%",
1632
+ },
1633
+ {
1634
+ name: 'IsPhoneNumber',
1635
+ minArgs: 1,
1636
+ maxArgs: 1,
1637
+ category: 'Utility',
1638
+ description: 'Returns true if the value is a valid phone number.',
1639
+ params: [{ name: 'value', description: 'Value to validate', type: 'string' }],
1640
+ returnType: 'boolean',
1641
+ syntax: 'IsPhoneNumber(value)',
1642
+ },
1643
+ {
1644
+ name: 'Length',
1645
+ minArgs: 1,
1646
+ maxArgs: 1,
1647
+ category: 'String',
1648
+ description: 'Returns the number of characters in a string.',
1649
+ params: [{ name: 'string', description: 'String to measure', type: 'string' }],
1650
+ returnType: 'number',
1651
+ syntax: 'Length(string)',
1652
+ example: "%%=Length('Hello')=%%",
1653
+ },
1654
+ {
1655
+ name: 'LiveContentMicrositeURL',
1656
+ minArgs: 2,
1657
+ maxArgs: 2,
1658
+ category: 'Content',
1659
+ description: 'Generates a URL to a microsite page that serves live, dynamic content.',
1660
+ params: [
1661
+ { name: 'pageId', description: 'Microsite page ID', type: 'number' },
1662
+ { name: 'contentId', description: 'Live content block ID', type: 'number' },
1663
+ ],
1664
+ returnType: 'string',
1665
+ syntax: 'LiveContentMicrositeURL(pageId, contentId)',
1666
+ },
1667
+ {
1668
+ name: 'LocalDateToSystemDate',
1669
+ minArgs: 1,
1670
+ maxArgs: 1,
1671
+ category: 'Date and Time',
1672
+ description: 'Converts a local date to the Marketing Cloud system date (Central Time).',
1673
+ params: [{ name: 'localDate', description: 'Local date to convert', type: 'date' }],
1674
+ returnType: 'date',
1675
+ syntax: 'LocalDateToSystemDate(localDate)',
1676
+ },
1677
+ {
1678
+ name: 'LongSFID',
1679
+ minArgs: 1,
1680
+ maxArgs: 1,
1681
+ category: 'Sales and Service Cloud',
1682
+ description:
1683
+ 'Converts a 15-character case-sensitive Salesforce ID to the 18-character case-insensitive version.',
1684
+ params: [{ name: 'sfid15', description: '15-character Salesforce ID', type: 'string' }],
1685
+ returnType: 'string',
1686
+ syntax: 'LongSFID(sfid15)',
1687
+ },
1688
+ {
1689
+ name: 'Lookup',
1690
+ minArgs: 4,
1691
+ maxArgs: INF,
1692
+ category: 'Data Extension',
1693
+ description:
1694
+ 'Returns a single field value from the first matching row in a data extension.',
1695
+ params: [
1696
+ { name: 'dataExtensionName', description: 'Data extension to query', type: 'string' },
1697
+ { name: 'returnColumn', description: 'Column whose value to return', type: 'string' },
1698
+ { name: 'lookupColumn', description: 'Filter column name', type: 'string' },
1699
+ { name: 'lookupValue', description: 'Filter column value' },
1700
+ {
1701
+ name: 'additionalColumn',
1702
+ description: 'Additional filter column',
1703
+ type: 'string',
1704
+ optional: true,
1705
+ },
1706
+ { name: 'additionalValue', description: 'Additional filter value', optional: true },
1707
+ ],
1708
+ returnType: 'string',
1709
+ syntax: 'Lookup(dataExtensionName, returnColumn, lookupColumn, lookupValue[, ...])',
1710
+ example: "%%=Lookup('MyDE', 'Email', 'ID', '123')=%%",
1711
+ },
1712
+ {
1713
+ name: 'LookupOrderedRows',
1714
+ minArgs: 5,
1715
+ maxArgs: INF,
1716
+ category: 'Data Extension',
1717
+ description: 'Returns a sorted rowset of matching rows from a data extension.',
1718
+ params: [
1719
+ { name: 'dataExtensionName', description: 'Data extension to query', type: 'string' },
1720
+ { name: 'maxRows', description: 'Maximum rows to return', type: 'number' },
1721
+ {
1722
+ name: 'sortColumn',
1723
+ description: "Sort column and direction (e.g. 'Date DESC')",
1724
+ type: 'string',
1725
+ },
1726
+ { name: 'lookupColumn', description: 'Filter column name', type: 'string' },
1727
+ { name: 'lookupValue', description: 'Filter column value' },
1728
+ {
1729
+ name: 'additionalColumn',
1730
+ description: 'Additional filter column',
1731
+ type: 'string',
1732
+ optional: true,
1733
+ },
1734
+ { name: 'additionalValue', description: 'Additional filter value', optional: true },
1735
+ ],
1736
+ returnType: 'rowset',
1737
+ syntax: 'LookupOrderedRows(dataExtensionName, maxRows, sortColumn, lookupColumn, lookupValue[, ...])',
1738
+ },
1739
+ {
1740
+ name: 'LookupOrderedRowsCS',
1741
+ minArgs: 5,
1742
+ maxArgs: INF,
1743
+ category: 'Data Extension',
1744
+ description:
1745
+ 'Case-sensitive version of LookupOrderedRows. Returns a sorted rowset of matching rows.',
1746
+ params: [
1747
+ { name: 'dataExtensionName', description: 'Data extension to query', type: 'string' },
1748
+ { name: 'maxRows', description: 'Maximum rows to return', type: 'number' },
1749
+ { name: 'sortColumn', description: 'Sort column and direction', type: 'string' },
1750
+ { name: 'lookupColumn', description: 'Filter column name', type: 'string' },
1751
+ { name: 'lookupValue', description: 'Filter column value' },
1752
+ {
1753
+ name: 'additionalColumn',
1754
+ description: 'Additional filter column',
1755
+ type: 'string',
1756
+ optional: true,
1757
+ },
1758
+ { name: 'additionalValue', description: 'Additional filter value', optional: true },
1759
+ ],
1760
+ returnType: 'rowset',
1761
+ syntax: 'LookupOrderedRowsCS(dataExtensionName, maxRows, sortColumn, lookupColumn, lookupValue[, ...])',
1762
+ },
1763
+ {
1764
+ name: 'LookupRows',
1765
+ minArgs: 3,
1766
+ maxArgs: INF,
1767
+ category: 'Data Extension',
1768
+ description: 'Returns a rowset of all matching rows from a data extension.',
1769
+ params: [
1770
+ { name: 'dataExtensionName', description: 'Data extension to query', type: 'string' },
1771
+ { name: 'lookupColumn', description: 'Filter column name', type: 'string' },
1772
+ { name: 'lookupValue', description: 'Filter column value' },
1773
+ {
1774
+ name: 'additionalColumn',
1775
+ description: 'Additional filter column',
1776
+ type: 'string',
1777
+ optional: true,
1778
+ },
1779
+ { name: 'additionalValue', description: 'Additional filter value', optional: true },
1780
+ ],
1781
+ returnType: 'rowset',
1782
+ syntax: 'LookupRows(dataExtensionName, lookupColumn, lookupValue[, ...])',
1783
+ example: "%%=LookupRows('MyDE', 'Status', 'Active')=%%",
1784
+ },
1785
+ {
1786
+ name: 'LookupRowsCS',
1787
+ minArgs: 3,
1788
+ maxArgs: INF,
1789
+ category: 'Data Extension',
1790
+ description: 'Case-sensitive version of LookupRows. Returns a rowset of matching rows.',
1791
+ params: [
1792
+ { name: 'dataExtensionName', description: 'Data extension to query', type: 'string' },
1793
+ { name: 'lookupColumn', description: 'Filter column name', type: 'string' },
1794
+ { name: 'lookupValue', description: 'Filter column value' },
1795
+ {
1796
+ name: 'additionalColumn',
1797
+ description: 'Additional filter column',
1798
+ type: 'string',
1799
+ optional: true,
1800
+ },
1801
+ { name: 'additionalValue', description: 'Additional filter value', optional: true },
1802
+ ],
1803
+ returnType: 'rowset',
1804
+ syntax: 'LookupRowsCS(dataExtensionName, lookupColumn, lookupValue[, ...])',
1805
+ },
1806
+ {
1807
+ name: 'Lowercase',
1808
+ minArgs: 1,
1809
+ maxArgs: 1,
1810
+ category: 'String',
1811
+ description: 'Converts a string to all lowercase characters.',
1812
+ params: [{ name: 'string', description: 'String to convert', type: 'string' }],
1813
+ returnType: 'string',
1814
+ syntax: 'Lowercase(string)',
1815
+ example: "%%=Lowercase('HELLO')=%%",
1816
+ },
1817
+ {
1818
+ name: 'MD5',
1819
+ minArgs: 1,
1820
+ maxArgs: 2,
1821
+ category: 'Encryption and Encoding',
1822
+ description: 'Returns the MD5 hash of the input value.',
1823
+ params: [
1824
+ { name: 'value', description: 'Value to hash', type: 'string' },
1825
+ {
1826
+ name: 'encoding',
1827
+ description: 'Output encoding (hex, base64)',
1828
+ type: 'string',
1829
+ optional: true,
1830
+ },
1831
+ ],
1832
+ returnType: 'string',
1833
+ syntax: 'MD5(value[, encoding])',
1834
+ },
1835
+ {
1836
+ name: 'MicrositeURL',
1837
+ minArgs: 1,
1838
+ maxArgs: INF,
1839
+ category: 'Utility',
1840
+ description: 'Generates a tracked URL to a microsite page, optionally passing parameters.',
1841
+ params: [
1842
+ { name: 'pageId', description: 'Microsite page ID', type: 'number' },
1843
+ {
1844
+ name: 'paramName',
1845
+ description: 'Query parameter name',
1846
+ type: 'string',
1847
+ optional: true,
1848
+ },
1849
+ {
1850
+ name: 'paramValue',
1851
+ description: 'Query parameter value',
1852
+ type: 'string',
1853
+ optional: true,
1854
+ },
1855
+ ],
1856
+ returnType: 'string',
1857
+ syntax: 'MicrositeURL(pageId[, paramName1, paramValue1, ...])',
1858
+ },
1859
+ {
1860
+ name: 'Mod',
1861
+ minArgs: 2,
1862
+ maxArgs: 2,
1863
+ category: 'Math',
1864
+ description:
1865
+ 'Returns the remainder after dividing the first number by the second (modulo).',
1866
+ params: [
1867
+ { name: 'dividend', description: 'Number to divide', type: 'number' },
1868
+ { name: 'divisor', description: 'Number to divide by', type: 'number' },
1869
+ ],
1870
+ returnType: 'number',
1871
+ syntax: 'Mod(dividend, divisor)',
1872
+ example: '%%=Mod(10, 3)=%%',
1873
+ },
1874
+ {
1875
+ name: 'Multiply',
1876
+ minArgs: 2,
1877
+ maxArgs: 2,
1878
+ category: 'Math',
1879
+ description: 'Computes the product of two numeric values.',
1880
+ params: [
1881
+ { name: 'factor1', description: 'First operand', type: 'number' },
1882
+ { name: 'factor2', description: 'Second operand', type: 'number' },
1883
+ ],
1884
+ returnType: 'number',
1885
+ syntax: 'Multiply(factor1, factor2)',
1886
+ example: '%%=Multiply(5, 3)=%%',
1887
+ },
1888
+ {
1889
+ name: 'Now',
1890
+ minArgs: 0,
1891
+ maxArgs: 1,
1892
+ category: 'Date and Time',
1893
+ description:
1894
+ 'Returns the current system date and time (Central Time). Pass 1 to persist the value across renders.',
1895
+ params: [
1896
+ {
1897
+ name: 'persistFormat',
1898
+ description: 'Pass 1 to persist value',
1899
+ type: 'boolean',
1900
+ optional: true,
1901
+ },
1902
+ ],
1903
+ returnType: 'date',
1904
+ syntax: 'Now([persistFormat])',
1905
+ example: '%%=Now()=%%',
1906
+ },
1907
+ {
1908
+ name: 'Output',
1909
+ minArgs: 1,
1910
+ maxArgs: 1,
1911
+ category: 'Utility',
1912
+ description:
1913
+ 'Writes a value to the rendered output. Used inside script blocks to emit content.',
1914
+ params: [{ name: 'content', description: 'Content to output' }],
1915
+ returnType: 'void',
1916
+ syntax: 'Output(content)',
1917
+ },
1918
+ {
1919
+ name: 'OutputLine',
1920
+ minArgs: 1,
1921
+ maxArgs: 1,
1922
+ category: 'Utility',
1923
+ description: 'Writes a value followed by a line break to the rendered output.',
1924
+ params: [{ name: 'content', description: 'Content to output' }],
1925
+ returnType: 'void',
1926
+ syntax: 'OutputLine(content)',
1927
+ },
1928
+ {
1929
+ name: 'ProperCase',
1930
+ minArgs: 1,
1931
+ maxArgs: 1,
1932
+ category: 'String',
1933
+ description:
1934
+ 'Converts a string to proper (title) case, capitalizing the first letter of each word.',
1935
+ params: [{ name: 'string', description: 'String to convert', type: 'string' }],
1936
+ returnType: 'string',
1937
+ syntax: 'ProperCase(string)',
1938
+ example: "%%=ProperCase('hello world')=%%",
1939
+ },
1940
+ {
1941
+ name: 'QueryParameter',
1942
+ minArgs: 1,
1943
+ maxArgs: 1,
1944
+ category: 'Utility',
1945
+ description:
1946
+ 'Returns the value of a URL query string parameter from the current page request.',
1947
+ params: [{ name: 'parameterName', description: 'Query parameter name', type: 'string' }],
1948
+ returnType: 'string',
1949
+ syntax: 'QueryParameter(parameterName)',
1950
+ },
1951
+ {
1952
+ name: 'RaiseError',
1953
+ minArgs: 1,
1954
+ maxArgs: 5,
1955
+ category: 'Utility',
1956
+ description:
1957
+ 'Raises a runtime error, optionally skipping the current subscriber or returning an API error.',
1958
+ params: [
1959
+ { name: 'message', description: 'Error message', type: 'string' },
1960
+ {
1961
+ name: 'skipSubscriber',
1962
+ description: 'Skip subscriber without failing the job',
1963
+ type: 'boolean',
1964
+ optional: true,
1965
+ },
1966
+ {
1967
+ name: 'apiErrorCode',
1968
+ description: 'Custom API error code',
1969
+ type: 'string',
1970
+ optional: true,
1971
+ },
1972
+ {
1973
+ name: 'apiErrorMessage',
1974
+ description: 'Custom API error message',
1975
+ type: 'string',
1976
+ optional: true,
1977
+ },
1978
+ {
1979
+ name: 'statusCode',
1980
+ description: 'HTTP status code for landing pages',
1981
+ type: 'number',
1982
+ optional: true,
1983
+ },
1984
+ ],
1985
+ returnType: 'void',
1986
+ syntax: 'RaiseError(message[, skipSubscriber, apiErrorCode, apiErrorMessage, statusCode])',
1987
+ },
1988
+ {
1989
+ name: 'Random',
1990
+ minArgs: 2,
1991
+ maxArgs: 2,
1992
+ category: 'Math',
1993
+ description: 'Returns a random integer between the two specified values (inclusive).',
1994
+ params: [
1995
+ { name: 'min', description: 'Lower bound (inclusive)', type: 'number' },
1996
+ { name: 'max', description: 'Upper bound (inclusive)', type: 'number' },
1997
+ ],
1998
+ returnType: 'number',
1999
+ syntax: 'Random(min, max)',
2000
+ example: '%%=Random(1, 100)=%%',
2001
+ },
2002
+ {
2003
+ name: 'RatingStars',
2004
+ minArgs: 3,
2005
+ maxArgs: 3,
2006
+ category: 'Einstein Email Recommendations',
2007
+ description: 'Renders a star-rating image using Einstein recommendations data.',
2008
+ params: [
2009
+ { name: 'rating', description: 'Current rating value', type: 'number' },
2010
+ { name: 'maxRating', description: 'Maximum rating value', type: 'number' },
2011
+ { name: 'imageUrl', description: 'Base URL for star images', type: 'string' },
2012
+ ],
2013
+ returnType: 'string',
2014
+ syntax: 'RatingStars(rating, maxRating, imageUrl)',
2015
+ },
2016
+ {
2017
+ name: 'Redirect',
2018
+ minArgs: 1,
2019
+ maxArgs: 1,
2020
+ category: 'Utility',
2021
+ description: 'Performs an HTTP redirect to the specified URL. Landing pages only.',
2022
+ params: [{ name: 'url', description: 'Target URL', type: 'string' }],
2023
+ returnType: 'void',
2024
+ syntax: 'Redirect(url)',
2025
+ },
2026
+ {
2027
+ name: 'RedirectTo',
2028
+ minArgs: 1,
2029
+ maxArgs: 1,
2030
+ category: 'Utility',
2031
+ description: 'Creates a trackable redirect URL, typically used in email links.',
2032
+ params: [{ name: 'url', description: 'Target URL', type: 'string' }],
2033
+ returnType: 'string',
2034
+ syntax: 'RedirectTo(url)',
2035
+ example: '%%=RedirectTo(@targetUrl)=%%',
2036
+ },
2037
+ {
2038
+ name: 'RegExMatch',
2039
+ minArgs: 3,
2040
+ maxArgs: INF,
2041
+ category: 'String',
2042
+ description:
2043
+ 'Tests a string against a regular expression pattern and captures matched groups.',
2044
+ params: [
2045
+ { name: 'string', description: 'String to match against', type: 'string' },
2046
+ { name: 'pattern', description: 'Regular expression pattern', type: 'string' },
2047
+ {
2048
+ name: 'match1',
2049
+ description: 'Output variable for first capture group',
2050
+ type: 'string',
2051
+ },
2052
+ {
2053
+ name: 'matchN',
2054
+ description: 'Output variable for additional capture groups',
2055
+ type: 'string',
2056
+ optional: true,
2057
+ },
2058
+ ],
2059
+ returnType: 'boolean',
2060
+ syntax: 'RegExMatch(string, pattern, @match1[, @matchN, ...])',
2061
+ },
2062
+ {
2063
+ name: 'Replace',
2064
+ minArgs: 3,
2065
+ maxArgs: 3,
2066
+ category: 'String',
2067
+ description: 'Replaces all occurrences of a substring with a new value.',
2068
+ params: [
2069
+ { name: 'string', description: 'Source string', type: 'string' },
2070
+ { name: 'oldValue', description: 'Substring to find', type: 'string' },
2071
+ { name: 'newValue', description: 'Replacement string', type: 'string' },
2072
+ ],
2073
+ returnType: 'string',
2074
+ syntax: 'Replace(string, oldValue, newValue)',
2075
+ example: "%%=Replace('Hello World', 'World', 'There')=%%",
2076
+ },
2077
+ {
2078
+ name: 'ReplaceList',
2079
+ minArgs: 3,
2080
+ maxArgs: INF,
2081
+ category: 'String',
2082
+ description: 'Replaces multiple old values in a string with a single new value.',
2083
+ params: [
2084
+ { name: 'string', description: 'Source string', type: 'string' },
2085
+ { name: 'newValue', description: 'Replacement string', type: 'string' },
2086
+ { name: 'oldValue1', description: 'First value to replace', type: 'string' },
2087
+ {
2088
+ name: 'oldValueN',
2089
+ description: 'Additional value to replace',
2090
+ type: 'string',
2091
+ optional: true,
2092
+ },
2093
+ ],
2094
+ returnType: 'string',
2095
+ syntax: 'ReplaceList(string, newValue, oldValue1[, oldValueN, ...])',
2096
+ },
2097
+ {
2098
+ name: 'RequestParameter',
2099
+ minArgs: 1,
2100
+ maxArgs: 1,
2101
+ category: 'Utility',
2102
+ description:
2103
+ 'Returns the value of a form post or query string parameter from the current request.',
2104
+ params: [{ name: 'parameterName', description: 'Parameter name', type: 'string' }],
2105
+ returnType: 'string',
2106
+ syntax: 'RequestParameter(parameterName)',
2107
+ },
2108
+ {
2109
+ name: 'RetrieveMSCRMRecords',
2110
+ minArgs: 5,
2111
+ maxArgs: 5,
2112
+ category: 'Microsoft Dynamics CRM',
2113
+ description: 'Retrieves records from Dynamics CRM using a simple filter.',
2114
+ params: [
2115
+ { name: 'entityType', description: 'CRM entity type name', type: 'string' },
2116
+ {
2117
+ name: 'fieldList',
2118
+ description: 'Comma-separated field names to retrieve',
2119
+ type: 'string',
2120
+ },
2121
+ { name: 'filterField', description: 'Filter field name', type: 'string' },
2122
+ { name: 'filterOperator', description: 'Comparison operator', type: 'string' },
2123
+ { name: 'filterValue', description: 'Filter value' },
2124
+ ],
2125
+ returnType: 'rowset',
2126
+ syntax: 'RetrieveMSCRMRecords(entityType, fieldList, filterField, filterOperator, filterValue)',
2127
+ },
2128
+ {
2129
+ name: 'RetrieveMSCRMRecordsFetchXML',
2130
+ minArgs: 1,
2131
+ maxArgs: 1,
2132
+ category: 'Microsoft Dynamics CRM',
2133
+ description: 'Retrieves records from Dynamics CRM using a FetchXML query.',
2134
+ params: [{ name: 'fetchXml', description: 'FetchXML query string', type: 'string' }],
2135
+ returnType: 'rowset',
2136
+ syntax: 'RetrieveMSCRMRecordsFetchXML(fetchXml)',
2137
+ },
2138
+ {
2139
+ name: 'RetrieveSalesforceJobSources',
2140
+ minArgs: 1,
2141
+ maxArgs: 1,
2142
+ category: 'Sales and Service Cloud',
2143
+ description: 'Retrieves the data sources associated with a Salesforce-triggered send job.',
2144
+ params: [{ name: 'jobId', description: 'Job identifier', type: 'string' }],
2145
+ returnType: 'rowset',
2146
+ syntax: 'RetrieveSalesforceJobSources(jobId)',
2147
+ },
2148
+ {
2149
+ name: 'RetrieveSalesforceObjects',
2150
+ minArgs: 5,
2151
+ maxArgs: INF,
2152
+ category: 'Sales and Service Cloud',
2153
+ description: 'Retrieves records from a connected Salesforce CRM object.',
2154
+ params: [
2155
+ { name: 'objectType', description: 'Salesforce object API name', type: 'string' },
2156
+ { name: 'fieldList', description: 'Comma-separated field names', type: 'string' },
2157
+ { name: 'filterField', description: 'Filter field API name', type: 'string' },
2158
+ { name: 'operator', description: 'Comparison operator (=, !=, >, <)', type: 'string' },
2159
+ { name: 'filterValue', description: 'Filter value' },
2160
+ {
2161
+ name: 'additionalFilterField',
2162
+ description: 'Additional filter field',
2163
+ type: 'string',
2164
+ optional: true,
2165
+ },
2166
+ {
2167
+ name: 'additionalOperator',
2168
+ description: 'Additional operator',
2169
+ type: 'string',
2170
+ optional: true,
2171
+ },
2172
+ {
2173
+ name: 'additionalFilterValue',
2174
+ description: 'Additional filter value',
2175
+ optional: true,
2176
+ },
2177
+ ],
2178
+ returnType: 'rowset',
2179
+ syntax: 'RetrieveSalesforceObjects(objectType, fieldList, filterField, operator, filterValue[, ...])',
2180
+ },
2181
+ {
2182
+ name: 'Row',
2183
+ minArgs: 2,
2184
+ maxArgs: 2,
2185
+ category: 'Data Extension',
2186
+ description: 'Returns a specific row from a rowset by its 1-based index.',
2187
+ params: [
2188
+ { name: 'rowset', description: 'Rowset to access' },
2189
+ { name: 'rowIndex', description: '1-based row index', type: 'number' },
2190
+ ],
2191
+ returnType: 'row',
2192
+ syntax: 'Row(rowset, rowIndex)',
2193
+ example: '%%=Row(@rows, 1)=%%',
2194
+ },
2195
+ {
2196
+ name: 'RowCount',
2197
+ minArgs: 1,
2198
+ maxArgs: 1,
2199
+ category: 'Data Extension',
2200
+ description: 'Returns the number of rows in a rowset.',
2201
+ params: [{ name: 'rowset', description: 'Rowset to count' }],
2202
+ returnType: 'number',
2203
+ syntax: 'RowCount(rowset)',
2204
+ example: '%%=RowCount(@rows)=%%',
2205
+ },
2206
+ {
2207
+ name: 'SetObjectProperty',
2208
+ minArgs: 3,
2209
+ maxArgs: 3,
2210
+ category: 'Marketing Cloud API',
2211
+ description: 'Sets a property value on a Marketing Cloud API object.',
2212
+ params: [
2213
+ { name: 'apiObject', description: 'API object reference' },
2214
+ { name: 'propertyName', description: 'Property name to set', type: 'string' },
2215
+ { name: 'value', description: 'Value to assign' },
2216
+ ],
2217
+ returnType: 'void',
2218
+ syntax: 'SetObjectProperty(apiObject, propertyName, value)',
2219
+ },
2220
+ {
2221
+ name: 'SetSmsConversationNextKeyword',
2222
+ minArgs: 3,
2223
+ maxArgs: 3,
2224
+ category: 'MobileConnect',
2225
+ description: 'Sets the next expected keyword for an active SMS conversation.',
2226
+ params: [
2227
+ { name: 'shortCode', description: 'SMS short code', type: 'string' },
2228
+ { name: 'keyword', description: 'Current conversation keyword', type: 'string' },
2229
+ { name: 'nextKeyword', description: 'Next expected keyword', type: 'string' },
2230
+ ],
2231
+ returnType: 'void',
2232
+ syntax: 'SetSmsConversationNextKeyword(shortCode, keyword, nextKeyword)',
2233
+ },
2234
+ {
2235
+ name: 'SetStateMSCRMRecord',
2236
+ minArgs: 4,
2237
+ maxArgs: 4,
2238
+ category: 'Microsoft Dynamics CRM',
2239
+ description: 'Sets the state and status of a Dynamics CRM record.',
2240
+ params: [
2241
+ { name: 'entityType', description: 'CRM entity type name', type: 'string' },
2242
+ { name: 'entityId', description: 'CRM record identifier', type: 'string' },
2243
+ { name: 'state', description: 'New state value', type: 'string' },
2244
+ { name: 'status', description: 'New status value', type: 'string' },
2245
+ ],
2246
+ returnType: 'void',
2247
+ syntax: 'SetStateMSCRMRecord(entityType, entityId, state, status)',
2248
+ },
2249
+ {
2250
+ name: 'SetValue',
2251
+ minArgs: 2,
2252
+ maxArgs: 2,
2253
+ category: 'Utility',
2254
+ description: 'Sets the value of a subscriber or send-context attribute by name.',
2255
+ params: [
2256
+ { name: 'attributeName', description: 'Attribute name to set', type: 'string' },
2257
+ { name: 'value', description: 'Value to assign' },
2258
+ ],
2259
+ returnType: 'void',
2260
+ syntax: 'SetValue(attributeName, value)',
2261
+ },
2262
+ {
2263
+ name: 'SHA1',
2264
+ minArgs: 1,
2265
+ maxArgs: 2,
2266
+ category: 'Encryption and Encoding',
2267
+ description: 'Returns the SHA-1 hash of the input value.',
2268
+ params: [
2269
+ { name: 'value', description: 'Value to hash', type: 'string' },
2270
+ {
2271
+ name: 'encoding',
2272
+ description: 'Output encoding (hex, base64)',
2273
+ type: 'string',
2274
+ optional: true,
2275
+ },
2276
+ ],
2277
+ returnType: 'string',
2278
+ syntax: 'SHA1(value[, encoding])',
2279
+ },
2280
+ {
2281
+ name: 'SHA256',
2282
+ minArgs: 1,
2283
+ maxArgs: 2,
2284
+ category: 'Encryption and Encoding',
2285
+ description: 'Returns the SHA-256 hash of the input value.',
2286
+ params: [
2287
+ { name: 'value', description: 'Value to hash', type: 'string' },
2288
+ {
2289
+ name: 'encoding',
2290
+ description: 'Output encoding (hex, base64)',
2291
+ type: 'string',
2292
+ optional: true,
2293
+ },
2294
+ ],
2295
+ returnType: 'string',
2296
+ syntax: 'SHA256(value[, encoding])',
2297
+ example: "%%=SHA256('secret')=%%",
2298
+ },
2299
+ {
2300
+ name: 'SHA512',
2301
+ minArgs: 1,
2302
+ maxArgs: 2,
2303
+ category: 'Encryption and Encoding',
2304
+ description: 'Returns the SHA-512 hash of the input value.',
2305
+ params: [
2306
+ { name: 'value', description: 'Value to hash', type: 'string' },
2307
+ {
2308
+ name: 'encoding',
2309
+ description: 'Output encoding (hex, base64)',
2310
+ type: 'string',
2311
+ optional: true,
2312
+ },
2313
+ ],
2314
+ returnType: 'string',
2315
+ syntax: 'SHA512(value[, encoding])',
2316
+ },
2317
+ {
2318
+ name: 'StringToDate',
2319
+ minArgs: 1,
2320
+ maxArgs: 2,
2321
+ category: 'Date and Time',
2322
+ description: 'Converts a date string to a date value, optionally using a custom format.',
2323
+ params: [
2324
+ { name: 'dateString', description: 'String to convert', type: 'string' },
2325
+ { name: 'format', description: 'Date format pattern', type: 'string', optional: true },
2326
+ ],
2327
+ returnType: 'date',
2328
+ syntax: 'StringToDate(dateString[, format])',
2329
+ },
2330
+ {
2331
+ name: 'StringToHex',
2332
+ minArgs: 1,
2333
+ maxArgs: 2,
2334
+ category: 'Encryption and Encoding',
2335
+ description: 'Converts a string to its hexadecimal representation.',
2336
+ params: [
2337
+ { name: 'value', description: 'String to convert', type: 'string' },
2338
+ { name: 'encoding', description: 'Character encoding', type: 'string', optional: true },
2339
+ ],
2340
+ returnType: 'string',
2341
+ syntax: 'StringToHex(value[, encoding])',
2342
+ },
2343
+ {
2344
+ name: 'Substring',
2345
+ minArgs: 2,
2346
+ maxArgs: 3,
2347
+ category: 'String',
2348
+ description:
2349
+ 'Extracts a portion of a string starting at the given index for the specified length.',
2350
+ params: [
2351
+ { name: 'string', description: 'Source string', type: 'string' },
2352
+ { name: 'startIndex', description: '1-based start position', type: 'number' },
2353
+ {
2354
+ name: 'length',
2355
+ description: 'Number of characters to extract. If omitted, returns the remainder of the string.',
2356
+ type: 'number',
2357
+ optional: true,
2358
+ },
2359
+ ],
2360
+ returnType: 'string',
2361
+ syntax: 'Substring(string, startIndex[, length])',
2362
+ example: "%%=Substring('Hello World', 1, 5)=%%",
2363
+ },
2364
+ {
2365
+ name: 'Subtract',
2366
+ minArgs: 2,
2367
+ maxArgs: 2,
2368
+ category: 'Math',
2369
+ description: 'Computes the difference between two numeric values.',
2370
+ params: [
2371
+ { name: 'number1', description: 'First operand (minuend)', type: 'number' },
2372
+ { name: 'number2', description: 'Second operand (subtrahend)', type: 'number' },
2373
+ ],
2374
+ returnType: 'number',
2375
+ syntax: 'Subtract(number1, number2)',
2376
+ example: '%%=Subtract(50, 15)=%%',
2377
+ },
2378
+ {
2379
+ name: 'SystemDateToLocalDate',
2380
+ minArgs: 1,
2381
+ maxArgs: 1,
2382
+ category: 'Date and Time',
2383
+ description:
2384
+ "Converts a Marketing Cloud system date (Central Time) to the subscriber's local time.",
2385
+ params: [{ name: 'systemDate', description: 'System date to convert', type: 'date' }],
2386
+ returnType: 'date',
2387
+ syntax: 'SystemDateToLocalDate(systemDate)',
2388
+ },
2389
+ {
2390
+ name: 'TransformXML',
2391
+ minArgs: 2,
2392
+ maxArgs: 2,
2393
+ category: 'Content',
2394
+ description: 'Transforms an XML document using an XSLT stylesheet.',
2395
+ params: [
2396
+ { name: 'xml', description: 'XML document string', type: 'string' },
2397
+ { name: 'xslt', description: 'XSLT stylesheet string', type: 'string' },
2398
+ ],
2399
+ returnType: 'string',
2400
+ syntax: 'TransformXML(xml, xslt)',
2401
+ },
2402
+ {
2403
+ name: 'TreatAsContent',
2404
+ minArgs: 1,
2405
+ maxArgs: 1,
2406
+ category: 'Content',
2407
+ description:
2408
+ 'Evaluates a string as AMPscript content, rendering any embedded AMPscript expressions.',
2409
+ params: [
2410
+ {
2411
+ name: 'content',
2412
+ description: 'String containing AMPscript to evaluate',
2413
+ type: 'string',
2414
+ },
2415
+ ],
2416
+ returnType: 'string',
2417
+ syntax: 'TreatAsContent(content)',
2418
+ },
2419
+ {
2420
+ name: 'TreatAsContentArea',
2421
+ minArgs: 2,
2422
+ maxArgs: 3,
2423
+ category: 'Content',
2424
+ description:
2425
+ 'Treats a string as a content area, optionally assigning it to an impression region.',
2426
+ params: [
2427
+ { name: 'key', description: 'Content area key identifier', type: 'string' },
2428
+ { name: 'content', description: 'HTML/AMPscript content', type: 'string' },
2429
+ {
2430
+ name: 'impressionRegion',
2431
+ description: 'Impression region name',
2432
+ type: 'string',
2433
+ optional: true,
2434
+ },
2435
+ ],
2436
+ returnType: 'string',
2437
+ syntax: 'TreatAsContentArea(key, content[, impressionRegion])',
2438
+ },
2439
+ {
2440
+ name: 'Trim',
2441
+ minArgs: 1,
2442
+ maxArgs: 1,
2443
+ category: 'String',
2444
+ description: 'Removes leading and trailing whitespace from a string.',
2445
+ params: [{ name: 'string', description: 'String to trim', type: 'string' }],
2446
+ returnType: 'string',
2447
+ syntax: 'Trim(string)',
2448
+ example: "%%=Trim(' hello ')=%%",
2449
+ },
2450
+ {
2451
+ name: 'UpdateData',
2452
+ minArgs: 6,
2453
+ maxArgs: INF,
2454
+ category: 'Data Extension',
2455
+ description:
2456
+ 'Updates existing rows in a data extension that match the specified key columns.',
2457
+ params: [
2458
+ { name: 'dataExtensionName', description: 'Target data extension', type: 'string' },
2459
+ { name: 'keyColumnCount', description: 'Number of key column pairs', type: 'number' },
2460
+ { name: 'keyColumn1', description: 'First key column name', type: 'string' },
2461
+ { name: 'keyValue1', description: 'First key column value' },
2462
+ { name: 'updateColumn1', description: 'First column to update', type: 'string' },
2463
+ { name: 'updateValue1', description: 'First update value' },
2464
+ ],
2465
+ returnType: 'number',
2466
+ syntax: 'UpdateData(dataExtensionName, keyColumnCount, keyColumn1, keyValue1, updateColumn1, updateValue1[, ...])',
2467
+ },
2468
+ {
2469
+ name: 'UpdateDE',
2470
+ minArgs: 6,
2471
+ maxArgs: INF,
2472
+ category: 'Data Extension',
2473
+ description: 'Legacy alias for UpdateData. Updates existing rows in a data extension.',
2474
+ params: [
2475
+ { name: 'dataExtensionName', description: 'Target data extension', type: 'string' },
2476
+ { name: 'keyColumnCount', description: 'Number of key column pairs', type: 'number' },
2477
+ { name: 'keyColumn1', description: 'First key column name', type: 'string' },
2478
+ { name: 'keyValue1', description: 'First key column value' },
2479
+ { name: 'updateColumn1', description: 'First column to update', type: 'string' },
2480
+ { name: 'updateValue1', description: 'First update value' },
2481
+ ],
2482
+ returnType: 'number',
2483
+ syntax: 'UpdateDE(dataExtensionName, keyColumnCount, keyColumn1, keyValue1, updateColumn1, updateValue1[, ...])',
2484
+ },
2485
+ {
2486
+ name: 'UpdateMSCRMRecords',
2487
+ minArgs: 4,
2488
+ maxArgs: 4,
2489
+ category: 'Microsoft Dynamics CRM',
2490
+ description: 'Updates field values on an existing Dynamics CRM record.',
2491
+ params: [
2492
+ { name: 'entityType', description: 'CRM entity type name', type: 'string' },
2493
+ { name: 'entityId', description: 'CRM record identifier', type: 'string' },
2494
+ { name: 'fieldName', description: 'Field name to update', type: 'string' },
2495
+ { name: 'fieldValue', description: 'New field value' },
2496
+ ],
2497
+ returnType: 'void',
2498
+ syntax: 'UpdateMSCRMRecords(entityType, entityId, fieldName, fieldValue)',
2499
+ },
2500
+ {
2501
+ name: 'UpdateSingleSalesforceObject',
2502
+ minArgs: 4,
2503
+ maxArgs: INF,
2504
+ category: 'Sales and Service Cloud',
2505
+ description: 'Updates a single record in a connected Salesforce CRM object.',
2506
+ params: [
2507
+ { name: 'objectType', description: 'Salesforce object API name', type: 'string' },
2508
+ { name: 'objectId', description: 'Record ID to update', type: 'string' },
2509
+ { name: 'field1', description: 'First field API name to update', type: 'string' },
2510
+ { name: 'value1', description: 'First field value' },
2511
+ {
2512
+ name: 'fieldN',
2513
+ description: 'Additional field API name',
2514
+ type: 'string',
2515
+ optional: true,
2516
+ },
2517
+ { name: 'valueN', description: 'Additional field value', optional: true },
2518
+ ],
2519
+ returnType: 'number',
2520
+ syntax: 'UpdateSingleSalesforceObject(objectType, objectId, field1, value1[, fieldN, valueN, ...])',
2521
+ },
2522
+ {
2523
+ name: 'Uppercase',
2524
+ minArgs: 1,
2525
+ maxArgs: 1,
2526
+ category: 'String',
2527
+ description: 'Converts a string to all uppercase characters.',
2528
+ params: [{ name: 'string', description: 'String to convert', type: 'string' }],
2529
+ returnType: 'string',
2530
+ syntax: 'Uppercase(string)',
2531
+ example: "%%=Uppercase('hello')=%%",
2532
+ },
2533
+ {
2534
+ name: 'UpsertContact',
2535
+ minArgs: 5,
2536
+ maxArgs: INF,
2537
+ category: 'MobileConnect',
2538
+ description: 'Creates or updates a MobileConnect contact record.',
2539
+ params: [
2540
+ { name: 'apiKeyName', description: 'Push API key name', type: 'string' },
2541
+ { name: 'keyField', description: 'Contact key field name', type: 'string' },
2542
+ { name: 'keyValue', description: 'Contact key value' },
2543
+ { name: 'field1', description: 'First attribute name', type: 'string' },
2544
+ { name: 'value1', description: 'First attribute value' },
2545
+ {
2546
+ name: 'fieldN',
2547
+ description: 'Additional attribute name',
2548
+ type: 'string',
2549
+ optional: true,
2550
+ },
2551
+ { name: 'valueN', description: 'Additional attribute value', optional: true },
2552
+ ],
2553
+ returnType: 'void',
2554
+ syntax: 'UpsertContact(apiKeyName, keyField, keyValue, field1, value1[, fieldN, valueN, ...])',
2555
+ },
2556
+ {
2557
+ name: 'UpsertData',
2558
+ minArgs: 6,
2559
+ maxArgs: INF,
2560
+ category: 'Data Extension',
2561
+ description:
2562
+ 'Inserts a new row or updates an existing row in a data extension based on key columns.',
2563
+ params: [
2564
+ { name: 'dataExtensionName', description: 'Target data extension', type: 'string' },
2565
+ { name: 'keyColumnCount', description: 'Number of key column pairs', type: 'number' },
2566
+ { name: 'keyColumn1', description: 'First key column name', type: 'string' },
2567
+ { name: 'keyValue1', description: 'First key column value' },
2568
+ { name: 'upsertColumn1', description: 'First column to set', type: 'string' },
2569
+ { name: 'upsertValue1', description: 'First column value' },
2570
+ ],
2571
+ returnType: 'number',
2572
+ syntax: 'UpsertData(dataExtensionName, keyColumnCount, keyColumn1, keyValue1, upsertColumn1, upsertValue1[, ...])',
2573
+ },
2574
+ {
2575
+ name: 'UpsertDE',
2576
+ minArgs: 6,
2577
+ maxArgs: INF,
2578
+ category: 'Data Extension',
2579
+ description: 'Legacy alias for UpsertData. Inserts or updates a row in a data extension.',
2580
+ params: [
2581
+ { name: 'dataExtensionName', description: 'Target data extension', type: 'string' },
2582
+ { name: 'keyColumnCount', description: 'Number of key column pairs', type: 'number' },
2583
+ { name: 'keyColumn1', description: 'First key column name', type: 'string' },
2584
+ { name: 'keyValue1', description: 'First key column value' },
2585
+ { name: 'upsertColumn1', description: 'First column to set', type: 'string' },
2586
+ { name: 'upsertValue1', description: 'First column value' },
2587
+ ],
2588
+ returnType: 'number',
2589
+ syntax: 'UpsertDE(dataExtensionName, keyColumnCount, keyColumn1, keyValue1, upsertColumn1, upsertValue1[, ...])',
2590
+ },
2591
+ {
2592
+ name: 'UpsertMSCRMRecord',
2593
+ minArgs: 9,
2594
+ maxArgs: 9,
2595
+ category: 'Microsoft Dynamics CRM',
2596
+ description: 'Creates or updates a Dynamics CRM record based on a match field.',
2597
+ params: [
2598
+ { name: 'entityType', description: 'CRM entity type name', type: 'string' },
2599
+ {
2600
+ name: 'matchField',
2601
+ description: 'Field used to find existing record',
2602
+ type: 'string',
2603
+ },
2604
+ { name: 'matchValue', description: 'Value to match on', type: 'string' },
2605
+ { name: 'returnField1', description: 'First return field name', type: 'string' },
2606
+ { name: 'returnField2', description: 'Second return field name', type: 'string' },
2607
+ { name: 'field1', description: 'First field name to set', type: 'string' },
2608
+ { name: 'value1', description: 'First field value' },
2609
+ { name: 'field2', description: 'Second field name to set', type: 'string' },
2610
+ { name: 'value2', description: 'Second field value' },
2611
+ ],
2612
+ returnType: 'string',
2613
+ syntax: 'UpsertMSCRMRecord(entityType, matchField, matchValue, returnField1, returnField2, field1, value1, field2, value2)',
2614
+ },
2615
+ {
2616
+ name: 'URLEncode',
2617
+ minArgs: 1,
2618
+ maxArgs: 3,
2619
+ category: 'Encryption and Encoding',
2620
+ description: 'URL-encodes a string for safe inclusion in a URL.',
2621
+ params: [
2622
+ { name: 'url', description: 'String to encode', type: 'string' },
2623
+ {
2624
+ name: 'preserveEntities',
2625
+ description: 'Preserve HTML entities',
2626
+ type: 'boolean',
2627
+ optional: true,
2628
+ },
2629
+ { name: 'encoding', description: 'Character encoding', type: 'string', optional: true },
2630
+ ],
2631
+ returnType: 'string',
2632
+ syntax: 'URLEncode(url[, preserveEntities, encoding])',
2633
+ example: "%%=URLEncode('hello world')=%%",
2634
+ },
2635
+ {
2636
+ name: 'V',
2637
+ minArgs: 1,
2638
+ maxArgs: 1,
2639
+ category: 'Utility',
2640
+ description:
2641
+ 'Short alias for retrieving a variable value inline. Equivalent to %%=v(@var)=%%.',
2642
+ params: [{ name: 'variableName', description: 'Variable reference' }],
2643
+ returnType: 'string',
2644
+ syntax: 'V(variableName)',
2645
+ example: '%%=V(@myVar)=%%',
2646
+ },
2647
+ {
2648
+ name: 'WAT',
2649
+ minArgs: 1,
2650
+ maxArgs: INF,
2651
+ category: 'Utility',
2652
+ description: 'Wraps a URL with Web Analytics Tracking parameters for link tracking.',
2653
+ params: [
2654
+ { name: 'url', description: 'URL to wrap with tracking', type: 'string' },
2655
+ { name: 'alias', description: 'Tracking alias', type: 'string', optional: true },
2656
+ ],
2657
+ returnType: 'string',
2658
+ syntax: 'WAT(url[, alias, ...])',
2659
+ },
2660
+ {
2661
+ name: 'WATP',
2662
+ minArgs: 1,
2663
+ maxArgs: 1,
2664
+ category: 'Utility',
2665
+ description: 'Wraps a URL that already contains parameters with Web Analytics Tracking.',
2666
+ params: [{ name: 'url', description: 'URL with existing parameters', type: 'string' }],
2667
+ returnType: 'string',
2668
+ syntax: 'WATP(url)',
2669
+ },
2670
+ {
2671
+ name: 'WrapLongURL',
2672
+ minArgs: 1,
2673
+ maxArgs: 1,
2674
+ category: 'Utility',
2675
+ description: 'Wraps a long URL to prevent line-break issues in email clients.',
2676
+ params: [{ name: 'url', description: 'Long URL to wrap', type: 'string' }],
2677
+ returnType: 'string',
2678
+ syntax: 'WrapLongURL(url)',
2679
+ },
2680
+ ];
2681
+
2682
+ /** Case-insensitive lookup: lowercase name -> function entry */
2683
+ export const functionLookup = new Map(FUNCTIONS.map((f) => [f.name.toLowerCase(), f]));
2684
+
2685
+ /** Set of lowercase function names for quick membership checks */
2686
+ export const functionNames = new Set(FUNCTIONS.map((f) => f.name.toLowerCase()));
2687
+
2688
+ // ── Canonical casing map ─────────────────────────────────────────────────────
2689
+
2690
+ /** Ordered list of canonical PascalCase function names */
2691
+ export const CANONICAL_FUNCTIONS = FUNCTIONS.map((f) => f.name);
2692
+
2693
+ /** Map from lowercase -> canonical PascalCase name */
2694
+ export const FUNCTION_CANONICAL_MAP = new Map(
2695
+ CANONICAL_FUNCTIONS.map((name) => [name.toLowerCase(), name]),
2696
+ );
2697
+
2698
+ // ── Email-context restrictions ───────────────────────────────────────────────
2699
+
2700
+ const EMAIL_EXCLUDED_CATEGORIES = new Set(['Marketing Cloud API']);
2701
+
2702
+ const EMAIL_EXCLUDED_FUNCTIONS = new Set([
2703
+ 'insertdata',
2704
+ 'updatedata',
2705
+ 'upsertdata',
2706
+ 'deletedata',
2707
+ 'redirect',
2708
+ 'requestparameter',
2709
+ 'queryparameter',
2710
+ 'httprequestheader',
2711
+ 'isctmlbrowser',
2712
+ ]);
2713
+
2714
+ export function isEmailExcluded(functionName) {
2715
+ const lower = functionName.toLowerCase();
2716
+ if (EMAIL_EXCLUDED_FUNCTIONS.has(lower)) return true;
2717
+ const entry = functionLookup.get(lower);
2718
+ return entry ? EMAIL_EXCLUDED_CATEGORIES.has(entry.category) : false;
2719
+ }
2720
+
2721
+ // ── Deprecated functions ─────────────────────────────────────────────────────
2722
+ // Functions that have been superseded by newer alternatives. They still work
2723
+ // at runtime but should be avoided in new code.
2724
+
2725
+ export const DEPRECATED_FUNCTIONS = [
2726
+ {
2727
+ name: 'LookupValue',
2728
+ replacement: 'Lookup',
2729
+ reason: 'LookupValue was the original name; Lookup is the current standard.',
2730
+ },
2731
+ {
2732
+ name: 'InsertDE',
2733
+ replacement: 'InsertData',
2734
+ reason: 'InsertDE is a legacy alias for InsertData.',
2735
+ },
2736
+ {
2737
+ name: 'UpdateDE',
2738
+ replacement: 'UpdateData',
2739
+ reason: 'UpdateDE is a legacy alias for UpdateData.',
2740
+ },
2741
+ {
2742
+ name: 'UpsertDE',
2743
+ replacement: 'UpsertData',
2744
+ reason: 'UpsertDE is a legacy alias for UpsertData.',
2745
+ },
2746
+ {
2747
+ name: 'DeleteDE',
2748
+ replacement: 'DeleteData',
2749
+ reason: 'DeleteDE is a legacy alias for DeleteData.',
2750
+ },
2751
+ {
2752
+ name: 'ContentArea',
2753
+ replacement: 'ContentBlockByKey or ContentBlockByName',
2754
+ reason: 'ContentArea references classic content areas which are being phased out in favor of Content Builder.',
2755
+ },
2756
+ {
2757
+ name: 'ContentAreaByName',
2758
+ replacement: 'ContentBlockByName',
2759
+ reason: 'ContentAreaByName references classic content areas which are being phased out.',
2760
+ },
2761
+ ];
2762
+
2763
+ export const deprecatedFunctionLookup = new Map(
2764
+ DEPRECATED_FUNCTIONS.map((f) => [f.name.toLowerCase(), f]),
2765
+ );
2766
+
2767
+ // ── Keywords ─────────────────────────────────────────────────────────────────
2768
+
2769
+ export const AMPSCRIPT_KEYWORDS = [
2770
+ 'var',
2771
+ 'set',
2772
+ 'if',
2773
+ 'then',
2774
+ 'elseif',
2775
+ 'else',
2776
+ 'endif',
2777
+ 'for',
2778
+ 'to',
2779
+ 'downto',
2780
+ 'do',
2781
+ 'next',
2782
+ 'and',
2783
+ 'or',
2784
+ 'not',
2785
+ 'true',
2786
+ 'false',
2787
+ ];
2788
+
2789
+ // ── Personalization strings ──────────────────────────────────────────────────
2790
+
2791
+ export const PERSONALIZATION_STRINGS = [
2792
+ {
2793
+ name: '_subscriberKey',
2794
+ description: 'Unique identifier for the current subscriber or contact',
2795
+ },
2796
+ { name: 'emailaddr', description: 'Email address associated with the current subscriber' },
2797
+ { name: 'subscriberid', description: 'Numeric identifier in the All Subscribers list' },
2798
+ { name: 'firstname', description: 'First name attribute of the subscriber' },
2799
+ { name: 'lastname', description: 'Last name attribute of the subscriber' },
2800
+ { name: 'fullname', description: 'Full name attribute of the subscriber' },
2801
+ { name: 'emailname_', description: 'Display name of the current email message' },
2802
+ { name: '_emailid', description: 'Numeric identifier of the current email' },
2803
+ { name: 'jobid', description: 'Numeric job identifier for the current send operation' },
2804
+ { name: '_JobSubscriberBatchID', description: 'Batch identifier within the current send job' },
2805
+ { name: '_PreHeader', description: 'Preheader text associated with the current email' },
2806
+ { name: '_DataSourceName', description: 'Name of the data source driving the current send' },
2807
+ {
2808
+ name: '_messageContext',
2809
+ description: 'Render context indicator: SEND, PREVIEW, VAWP, or FTAF',
2810
+ },
2811
+ { name: '_isTestSend', description: 'Flag indicating whether this is a test send' },
2812
+ {
2813
+ name: '_messagetypepreference',
2814
+ description: 'Subscriber preference for HTML or plain-text messages',
2815
+ },
2816
+ { name: 'listid', description: 'Numeric identifier of the current send list' },
2817
+ { name: '_listname', description: 'Display name of the current send list' },
2818
+ { name: 'list_', description: 'Name of the list associated with the subscriber' },
2819
+ { name: 'listsubid', description: 'Subscriber identifier within a specific list' },
2820
+ { name: 'xtmonth', description: 'Full month name of the send date' },
2821
+ { name: 'xtmonthnumeric', description: 'Numeric month of the send date (1 through 12)' },
2822
+ { name: 'xtday', description: 'Day of month of the send date' },
2823
+ { name: 'xtdayofweek', description: 'Weekday name of the send date' },
2824
+ { name: 'xtyear', description: 'Four-digit year of the send date' },
2825
+ { name: 'xtshortdate', description: 'Send date in short date format' },
2826
+ { name: 'xtlongdate', description: 'Send date in long date format' },
2827
+ { name: 'replyname', description: 'Reply-to display name configured for the current send' },
2828
+ {
2829
+ name: 'replyemailaddress',
2830
+ description: 'Reply-to email address configured for the current send',
2831
+ },
2832
+ { name: 'memberid', description: 'Member ID (MID) of the sending business unit' },
2833
+ { name: 'member_busname', description: 'Business name of the sending business unit' },
2834
+ { name: 'member_addr', description: 'Street address of the sending business unit' },
2835
+ { name: 'member_city', description: 'City of the sending business unit' },
2836
+ { name: 'member_state', description: 'State or province of the sending business unit' },
2837
+ { name: 'member_postalcode', description: 'Postal code of the sending business unit' },
2838
+ { name: 'member_country', description: 'Country of the sending business unit' },
2839
+ { name: 'view_email_url', description: 'URL for the View as Web Page version of the email' },
2840
+ { name: 'ftaf_url', description: 'Forward to a Friend URL' },
2841
+ { name: 'subscription_center_url', description: 'URL to the subscription management center' },
2842
+ { name: 'profile_center_url', description: 'URL to the subscriber profile center' },
2843
+ { name: 'unsub_center_url', description: 'URL to the unsubscribe center' },
2844
+ { name: 'double_opt_in_url', description: 'URL for double opt-in confirmation' },
2845
+ {
2846
+ name: '_replycontent',
2847
+ description: 'Body content of a subscriber reply via Reply Mail Management',
2848
+ },
2849
+ { name: 'linkname', description: 'Alias or name assigned to the current tracked link' },
2850
+ {
2851
+ name: '_ImpressionRegionID',
2852
+ description: 'Numeric identifier of the current impression region',
2853
+ },
2854
+ { name: '_ImpressionRegionName', description: 'Display name of the current impression region' },
2855
+ { name: 'PAGEURL', description: 'URL of the current CloudPages or microsite page' },
2856
+ { name: 'MOBILE_NUMBER', description: 'Mobile number of the inbound SMS sender' },
2857
+ { name: 'SHORT_CODE', description: 'Short code or long code that received the SMS' },
2858
+ { name: 'MSG(0)', description: 'Complete text of the inbound SMS message' },
2859
+ { name: 'MSG(0).VERB', description: 'First word (keyword) of the inbound SMS' },
2860
+ { name: 'MSG(0).NOUNS', description: 'All text following the keyword in the inbound SMS' },
2861
+ { name: 'MSG(0).NOUN(1)', description: 'Second word of the inbound SMS message' },
2862
+ { name: 'MMS_CONTENT_URL(0)', description: 'URL of the first MMS attachment' },
2863
+ { name: '_CarrierID', description: 'Carrier identifier for a MobileConnect contact' },
2864
+ { name: '_Channel', description: 'Messaging channel for a MobileConnect contact' },
2865
+ { name: '_City', description: 'City from MobileConnect contact demographics' },
2866
+ { name: '_ContactID', description: 'Contact identifier in MobileConnect' },
2867
+ { name: '_CountryCode', description: 'Country code from MobileConnect contact demographics' },
2868
+ { name: '_CreatedBy', description: 'User who created the MobileConnect contact record' },
2869
+ { name: '_CreatedDate', description: 'Timestamp when the MobileConnect contact was created' },
2870
+ { name: '_FirstName', description: 'First name of the MobileConnect contact' },
2871
+ { name: '_LastName', description: 'Last name of the MobileConnect contact' },
2872
+ { name: '_MobileNumber', description: 'Mobile number of the MobileConnect contact' },
2873
+ { name: '_ModifiedBy', description: 'User who last modified the MobileConnect contact' },
2874
+ {
2875
+ name: '_ModifiedDate',
2876
+ description: 'Timestamp of the last modification to the MobileConnect contact',
2877
+ },
2878
+ { name: '_Priority', description: 'Message priority for the MobileConnect contact' },
2879
+ {
2880
+ name: '_Source',
2881
+ description: 'Origin channel through which the MobileConnect contact was added',
2882
+ },
2883
+ {
2884
+ name: '_SourceObjectID',
2885
+ description: 'Source object identifier for the MobileConnect contact',
2886
+ },
2887
+ { name: '_State', description: 'State from MobileConnect contact demographics' },
2888
+ { name: '_Status', description: 'Subscription status of the MobileConnect contact' },
2889
+ { name: '_UTCOffset', description: 'UTC offset for the MobileConnect contact timezone' },
2890
+ { name: '_ZipCode', description: 'ZIP or postal code from MobileConnect contact demographics' },
2891
+ { name: 'LINE_ADDRESS_ID', description: 'LINE user address identifier for GroupConnect' },
2892
+ {
2893
+ name: '@@ExecCtx',
2894
+ description: 'Execution context indicator: returns load or post on web pages',
2895
+ },
2896
+ ];