ampscript-data 3.1.1 → 3.3.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 +62 -5
  2. package/package.json +1 -1
  3. package/src/index.js +1204 -317
package/src/index.js CHANGED
@@ -5,10 +5,54 @@
5
5
  * - prettier-plugin-sfmc (casing normalization)
6
6
  * - eslint-plugin-sfmc (unknown-function detection, arity validation)
7
7
  * - vscode-sfmc-language (completions, hover, diagnostics)
8
+ *
9
+ * Optional verification-state fields on a FUNCTIONS entry:
10
+ * - isConfirmed?: boolean — true when the entry's behavior was verified against the
11
+ * live AMPscript engine. Absent means "never checked".
12
+ * - verificationBlocked?: boolean — true when a runtime verification was ATTEMPTED but
13
+ * could not complete for a concrete technical/environmental reason (no working
14
+ * invocation, missing auth/session context, absent test data). This is a THIRD state,
15
+ * distinct from both "verified" (isConfirmed: true) and "never checked" (neither flag
16
+ * set). When true, isConfirmed MUST be explicitly false and verificationBlockedReason
17
+ * MUST name the blocker category. The concrete, human-readable detail (error text,
18
+ * what was tried) belongs in officialDocsNote, not in the enum value.
19
+ * - verificationBlockedReason?: string — REQUIRED whenever verificationBlocked is true;
20
+ * one of the VERIFICATION_BLOCKED_REASONS enum values. Never set on its own.
21
+ * - differsFromOfficialDocs?: boolean — true when the verified runtime behavior contradicts
22
+ * the official Salesforce reference. Requires officialDocsNote to spell out the
23
+ * difference.
24
+ * - officialDocsNote?: string — human-readable evidence: what the official docs claim, what
25
+ * the runtime actually did, and what was tried.
8
26
  */
9
27
 
10
28
  const INF = Infinity;
11
29
 
30
+ // ── Verification-blocked reasons ─────────────────────────────────────────────
31
+ // Fixed enum of concrete technical/environmental reasons why a runtime verification
32
+ // was ATTEMPTED but could not complete. Set on an entry as `verificationBlockedReason`
33
+ // together with `verificationBlocked: true` and `isConfirmed: false`. The specific
34
+ // evidence (error text, invocation shapes tried) belongs in `officialDocsNote`, not here.
35
+ //
36
+ // - no-working-invocation probing found no invocation shape that works; document
37
+ // exactly what was tried in officialDocsNote.
38
+ // - needs-auth-context requires an authenticated / session / subscriber state that
39
+ // the probe context (e.g. a plain CloudPage) cannot supply
40
+ // - no-test-data requires pre-existing data or an integration that is not
41
+ // provisioned on the BU
42
+ // - classic-only-no-assets only works with classic (legacy) assets and none exist
43
+ // on the BU to test against
44
+ // - destructive-unsafe cannot be exercised without unacceptable side effects
45
+ /**
46
+ @type {readonly string[]}
47
+ */
48
+ export const VERIFICATION_BLOCKED_REASONS = Object.freeze([
49
+ 'no-working-invocation',
50
+ 'needs-auth-context',
51
+ 'no-test-data',
52
+ 'classic-only-no-assets',
53
+ 'destructive-unsafe',
54
+ ]);
55
+
12
56
  // ── Function catalog ─────────────────────────────────────────────────────────
13
57
 
14
58
  /**
@@ -25,27 +69,54 @@ const INF = Infinity;
25
69
  * Param naming convention for variadic functions: the first required occurrence of a
26
70
  * group member is `<base>1` and the repeating occurrence is `<base>N` (with `optional`).
27
71
  *
28
- @type {{name: string, mcnSince: number | null, mcnNotes: string | null, handlebarsEquivalent?: string | null, mcnHandlebarsGap?: boolean, docUrl?: string, guideUrl?: string, minArgs: number, maxArgs: number, category: string, description: string, params: {name: string, description: string, type?: string, enum?: (string | number)[], optional?: boolean, default?: string | number | boolean}[], returnType?: string, returnDescription?: string, returnEnum?: (string | number)[], syntax?: string, example?: string, repeat?: {startIndex: number, groupSize: number, minGroups: number, countParam?: string}[], deprecated?: boolean, deprecatedReplacement?: string, deprecatedReason?: string}[]} */
72
+ * `validArities` (OPTIONAL): exact set of permitted argument counts for a DISCONTINUOUS
73
+ * OVERLOAD, where a contiguous `minArgs..maxArgs` range would wrongly accept intermediate
74
+ * counts. When present, a call is valid only when its argument count is within
75
+ * [minArgs, maxArgs] AND a member of this array. The array MUST be strictly ascending
76
+ * integers, and both `minArgs` and `maxArgs` MUST be members (so `validArities[0] === minArgs`
77
+ * and the last element `=== maxArgs`). Example shape: a function that accepts exactly 1 or 6
78
+ * arguments (2-5 fail) would set `minArgs: 1, maxArgs: 6, validArities: [1, 6]`.
79
+ * Absent → behavior is a pure contiguous range. No AMPscript function currently needs it.
80
+ *
81
+ * `sfmcGuideUrl` (OPTIONAL): absolute URL of our own published reference page,
82
+ * `https://sfmc.guide/engagement/ampscript/functions/<lowercase-name>/`. Present ONLY when
83
+ * that page actually exists — it is written by the verification skills at step 4j, together
84
+ * with the page itself, and therefore always accompanies `isConfirmed: true`. Unlike `docUrl`
85
+ * (Salesforce) and `guideUrl` (ampscript.guide), this one points at content we own and have
86
+ * runtime-proven. Kept in sync by a cross-package test in `tests/cross-package.test.mjs`.
87
+ *
88
+ * `handlebarsExact` (OPTIONAL): only meaningful when `handlebarsEquivalent` names a helper.
89
+ * `true` means the helper is an argument-for-argument drop-in replacement for the AMPscript
90
+ * function. `false` means the helper does the same job but with a different call shape (dropped,
91
+ * shifted, or renamed arguments, or different error behaviour), so a converter must emit a hint
92
+ * for a human to finish the rewrite rather than a mechanical substitution. Must be present
93
+ * whenever `handlebarsEquivalent` is non-null.
94
+ *
95
+ @type {{name: string, mcnSince: number | null, mcnNotes: string | null, handlebarsEquivalent?: string | null, handlebarsExact?: boolean, docUrl?: string, guideUrl?: string, sfmcGuideUrl?: string, minArgs: number, maxArgs: number, validArities?: number[], category: string, description: string, params: {name: string, description: string, type?: string, enum?: (string | number)[], optional?: boolean, default?: string | number | boolean}[], returnType?: string, returnDescription?: string, returnEnum?: (string | number)[], syntax?: string, example?: string, repeat?: {startIndex: number, groupSize: number, minGroups: number, countParam?: string}[], deprecated?: boolean, deprecatedReplacement?: string, deprecatedReason?: string, isConfirmed?: boolean, verificationBlocked?: boolean, verificationBlockedReason?: string, differsFromOfficialDocs?: boolean, officialDocsNote?: string}[]} */
29
96
  export const FUNCTIONS = [
30
97
  {
31
98
  name: 'Add',
32
99
  mcnSince: 67,
33
100
  handlebarsEquivalent: 'add',
101
+ handlebarsExact: true,
34
102
  mcnNotes: null,
35
103
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-math/mc-ampscript-reference-math-add.html',
36
104
  guideUrl: 'https://ampscript.guide/add/',
105
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/add/',
37
106
  minArgs: 2,
38
107
  maxArgs: 2,
39
108
  category: 'Math',
40
109
  description: 'Computes the sum of two numeric values.',
41
110
  params: [
42
- { name: 'number1', description: 'First operand', type: 'number' },
43
- { name: 'number2', description: 'Second operand', type: 'number' },
111
+ { name: 'number1', description: 'First operand', type: 'string|number' },
112
+ { name: 'number2', description: 'Second operand', type: 'string|number' },
44
113
  ],
45
114
  returnType: 'number',
46
115
  returnDescription: 'The numeric sum of the two operands.',
47
116
  syntax: 'Add(number1, number2)',
48
117
  example: '%%=Add(15, 27)=%%',
118
+ isConfirmed: true,
119
+ differsFromOfficialDocs: false,
49
120
  },
50
121
  {
51
122
  name: 'AddMscrmListMember',
@@ -178,20 +249,32 @@ export const FUNCTIONS = [
178
249
  {
179
250
  name: 'AttributeValue',
180
251
  mcnSince: null,
181
- handlebarsEquivalent: null,
252
+ handlebarsEquivalent: 'personalizationResult',
253
+ handlebarsExact: false,
182
254
  mcnNotes: null,
183
255
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-utilities/mc-ampscript-reference-utilities-attribute-value.html',
184
256
  guideUrl: 'https://ampscript.guide/attributevalue/',
257
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/attributevalue/',
185
258
  minArgs: 1,
186
259
  maxArgs: 1,
187
260
  category: 'Utility',
188
261
  description:
189
- 'Safely retrieves a subscriber attribute value, returning empty string if null.',
190
- params: [{ name: 'attributeName', description: 'Attribute name', type: 'string' }],
262
+ 'Reads an attribute of the current message or page context by name, giving an empty value instead of failing when the name is unknown. The name is matched without regard to case, and system attributes such as the message context resolve on a CloudPage even though no subscriber is involved.',
263
+ params: [
264
+ {
265
+ name: 'attributeName',
266
+ description:
267
+ 'Attribute name, matched without regard to case; an empty name aborts the page',
268
+ type: 'string',
269
+ },
270
+ ],
191
271
  returnType: 'string',
192
- returnDescription: 'The value of the named subscriber or send attribute as a string.',
272
+ returnDescription:
273
+ 'The attribute value as a string, or an empty value when the name resolves to nothing.',
193
274
  syntax: 'AttributeValue(attributeName)',
194
275
  example: "%%=AttributeValue('firstname')=%%",
276
+ isConfirmed: true,
277
+ differsFromOfficialDocs: false,
195
278
  },
196
279
  {
197
280
  name: 'AuthenticatedEmployeeID',
@@ -203,10 +286,15 @@ export const FUNCTIONS = [
203
286
  minArgs: 0,
204
287
  maxArgs: 0,
205
288
  category: 'Utility',
206
- description: 'Returns the employee ID of the currently authenticated user.',
289
+ description:
290
+ 'Returns the numeric employee ID of the Marketing Cloud user tied to the current context. On a public CloudPage, where nobody is signed in, it still returns a non-empty ID rather than an empty value, so it cannot be used to tell an authenticated visitor apart from an anonymous one.',
207
291
  params: [],
208
292
  returnType: 'string',
209
- returnDescription: 'The ID of the authenticated employee, or empty when none is set.',
293
+ returnDescription:
294
+ 'The employee ID as a numeric string, usable directly in Concat and in comparisons. It was non-empty even without a signed-in visitor.',
295
+ isConfirmed: true,
296
+ differsFromOfficialDocs: false,
297
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/authenticatedemployeeid/',
210
298
  syntax: 'AuthenticatedEmployeeID()',
211
299
  example: '%%=AuthenticatedEmployeeID()=%%',
212
300
  },
@@ -220,10 +308,18 @@ export const FUNCTIONS = [
220
308
  minArgs: 0,
221
309
  maxArgs: 0,
222
310
  category: 'Utility',
223
- description: 'Returns the notification email address of the authenticated employee.',
311
+ description:
312
+ 'Returns the notification email address of the Marketing Cloud user tied to the current context. On a public CloudPage, where nobody is signed in, it still returns a non-empty address rather than an empty value, so it cannot be used to tell an authenticated visitor apart from an anonymous one. It is a separate value from AuthenticatedEmployeeUserName() — neither can be derived from the other.',
224
313
  params: [],
225
314
  returnType: 'string',
226
- returnDescription: 'The notification email address of the authenticated employee.',
315
+ returnDescription:
316
+ 'The notification address as a string, usable directly in Concat and in comparisons. On the business unit tested it was a real email address on a registered domain, and it was non-empty even without a signed-in visitor.',
317
+ isConfirmed: true,
318
+ differsFromOfficialDocs: true,
319
+ officialDocsNote:
320
+ 'Proven on the child BU MCDEV_Training_QA (MID 518005426); the parent BU was not needed. The official reference scopes the function to microsites that use sender authenticated redirection and explicitly says it is not for use with CloudPages. At runtime the opposite happened: an anonymous GET of a public CloudPage rendered at HTTP 200 and the call returned a well-formed, non-empty notification email address — Empty() answered false, Length() reported 29 characters and IsEmailAddress() accepted it. The value behaved as an ordinary string when used inline, nested inside Concat and compared against the empty string. The literal address is redacted here because it identifies an account user; only its shape is described.',
321
+ sfmcGuideUrl:
322
+ 'https://sfmc.guide/engagement/ampscript/functions/authenticatedemployeenotificationaddress/',
227
323
  syntax: 'AuthenticatedEmployeeNotificationAddress()',
228
324
  example: '%%=AuthenticatedEmployeeNotificationAddress()=%%',
229
325
  },
@@ -237,10 +333,16 @@ export const FUNCTIONS = [
237
333
  minArgs: 0,
238
334
  maxArgs: 0,
239
335
  category: 'Utility',
240
- description: 'Returns the username of the authenticated employee.',
336
+ description:
337
+ 'Returns the login username of the Marketing Cloud user tied to the current context. On a public CloudPage, where nobody is signed in, it still returns a non-empty username rather than an empty value, so it cannot be used to tell an authenticated visitor apart from an anonymous one.',
241
338
  params: [],
242
339
  returnType: 'string',
243
- returnDescription: 'The user name of the authenticated employee.',
340
+ returnDescription:
341
+ 'The username as a string, usable directly in Concat and in comparisons. On the business unit tested it was shaped like an email address and was non-empty even without a signed-in visitor.',
342
+ isConfirmed: true,
343
+ differsFromOfficialDocs: false,
344
+ sfmcGuideUrl:
345
+ 'https://sfmc.guide/engagement/ampscript/functions/authenticatedemployeeusername/',
244
346
  syntax: 'AuthenticatedEmployeeUserName()',
245
347
  example: '%%=AuthenticatedEmployeeUserName()=%%',
246
348
  },
@@ -254,10 +356,16 @@ export const FUNCTIONS = [
254
356
  minArgs: 0,
255
357
  maxArgs: 0,
256
358
  category: 'Utility',
257
- description: 'Returns the enterprise ID (top-level MID) of the authenticated user.',
359
+ description:
360
+ 'Returns the enterprise ID (EID) of the Marketing Cloud account tied to the current context. On a public CloudPage, where nobody is signed in, it still returns a non-empty ID rather than an empty value, so it cannot be used to tell an authenticated visitor apart from an anonymous one. Called from a child business unit it reports the parent (enterprise) MID, not the child MID, and it is a different value from AuthenticatedEmployeeID().',
258
361
  params: [],
259
362
  returnType: 'string',
260
- returnDescription: 'The enterprise ID (EID) of the authenticated context.',
363
+ returnDescription:
364
+ 'The enterprise ID as a digits-only numeric string, usable directly in Concat, in comparisons and in arithmetic. It was non-empty even without a signed-in visitor.',
365
+ isConfirmed: true,
366
+ differsFromOfficialDocs: false,
367
+ sfmcGuideUrl:
368
+ 'https://sfmc.guide/engagement/ampscript/functions/authenticatedenterpriseid/',
261
369
  syntax: 'AuthenticatedEnterpriseID()',
262
370
  example: '%%=AuthenticatedEnterpriseID()=%%',
263
371
  },
@@ -268,13 +376,18 @@ export const FUNCTIONS = [
268
376
  mcnNotes: null,
269
377
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-sites/mc-ampscript-reference-sites-authenticated-member-id.html',
270
378
  guideUrl: 'https://ampscript.guide/authenticatedmemberid/',
379
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/authenticatedmemberid/',
271
380
  minArgs: 0,
272
381
  maxArgs: 0,
273
382
  category: 'Utility',
274
- description: 'Returns the member ID (MID) of the authenticated business unit.',
383
+ description:
384
+ 'Returns the member ID (MID) of the business unit the code runs on. On a public CloudPage, where nobody is signed in, it still returns a non-empty MID rather than an empty value, so it cannot be used to tell an authenticated visitor apart from an anonymous one. Called from a child business unit it reports that CHILD MID, unlike AuthenticatedEnterpriseID(), which reports the parent (enterprise) MID in the same render.',
275
385
  params: [],
276
386
  returnType: 'string',
277
- returnDescription: 'The member ID (MID) of the authenticated business unit.',
387
+ returnDescription:
388
+ 'The member ID as a digits-only numeric string, usable directly in Concat, in comparisons and in arithmetic. It was non-empty even without a signed-in visitor.',
389
+ isConfirmed: true,
390
+ differsFromOfficialDocs: false,
278
391
  syntax: 'AuthenticatedMemberID()',
279
392
  example: '%%=AuthenticatedMemberID()=%%',
280
393
  },
@@ -285,13 +398,18 @@ export const FUNCTIONS = [
285
398
  mcnNotes: null,
286
399
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-sites/mc-ampscript-reference-sites-authenticated-member-name.html',
287
400
  guideUrl: 'https://ampscript.guide/authenticatedmembername/',
401
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/authenticatedmembername/',
288
402
  minArgs: 0,
289
403
  maxArgs: 0,
290
404
  category: 'Utility',
291
- description: 'Returns the name of the authenticated business unit.',
405
+ description:
406
+ 'Returns the display name of the business unit the code runs on. On a public CloudPage, where nobody is signed in, it still returns a non-empty name rather than an empty value, so it cannot be used to tell an authenticated visitor apart from an anonymous one. It is the business unit name as shown in the Marketing Cloud UI — spaces and punctuation included — not a person and not the login username returned by AuthenticatedEmployeeUserName() in the same render.',
292
407
  params: [],
293
408
  returnType: 'string',
294
- returnDescription: 'The name of the authenticated business unit.',
409
+ returnDescription:
410
+ 'The business unit display name as a free-text string that can contain spaces and punctuation, usable directly in Concat and in comparisons. It was non-empty even without a signed-in visitor.',
411
+ isConfirmed: true,
412
+ differsFromOfficialDocs: false,
295
413
  syntax: 'AuthenticatedMemberName()',
296
414
  example: '%%=AuthenticatedMemberName()=%%',
297
415
  },
@@ -390,23 +508,40 @@ export const FUNCTIONS = [
390
508
  minArgs: 1,
391
509
  maxArgs: 3,
392
510
  category: 'Encryption and Encoding',
393
- description: 'Decodes a Base64-encoded string.',
511
+ description:
512
+ 'Decodes a Base64-encoded string. The decoded bytes are read as UTF-8 unless encoding names another character encoding, and any value that is not well-formed Base64 aborts the page instead of returning an empty or partial result.',
394
513
  params: [
395
- { name: 'encodedString', description: 'Base64 string to decode', type: 'string' },
396
- { name: 'encoding', description: 'Encoding scheme', type: 'string', optional: true },
397
514
  {
398
- name: 'characterSet',
515
+ name: 'encodedString',
516
+ description:
517
+ 'Base64 string to decode; it must be well-formed, because malformed input aborts the page',
518
+ type: 'string',
519
+ },
520
+ {
521
+ name: 'encoding',
522
+ description:
523
+ 'Name of the character encoding used to turn the decoded bytes back into text; defaults to UTF-8, and an unrecognised or empty name aborts the page',
524
+ type: 'string',
525
+ enum: ['UTF-8', 'UTF-16', 'UTF-16BE', 'UTF-32', 'ASCII', 'ISO-8859-1'],
526
+ optional: true,
527
+ default: 'UTF-8',
528
+ },
529
+ {
530
+ name: 'abortOnFailure',
399
531
  mcnSince: null,
400
532
  mcnNotes: null,
401
- description: 'Character set for output',
402
- type: 'string',
533
+ description:
534
+ 'Flag reserved for send-time failure handling; 0, 1, true and false are all accepted and none of them changes the value a successful decode returns',
535
+ type: 'number|boolean',
403
536
  optional: true,
404
537
  },
405
538
  ],
406
539
  returnType: 'string',
407
540
  returnDescription: 'The decoded string.',
408
- syntax: 'Base64Decode(encodedString[, encoding, characterSet])',
541
+ syntax: 'Base64Decode(encodedString[, encoding, abortOnFailure])',
409
542
  example: "%%=Base64Decode('SGVsbG8=')=%%",
543
+ isConfirmed: true,
544
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/base64decode/',
410
545
  },
411
546
  {
412
547
  name: 'Base64Encode',
@@ -418,15 +553,31 @@ export const FUNCTIONS = [
418
553
  minArgs: 1,
419
554
  maxArgs: 2,
420
555
  category: 'Encryption and Encoding',
421
- description: 'Encodes a value as a Base64 string.',
556
+ description:
557
+ 'Encodes a value as a Base64 string. The bytes encoded are the UTF-8 representation of the input unless encoding names another character encoding.',
422
558
  params: [
423
- { name: 'value', description: 'Value to encode', type: 'string' },
424
- { name: 'encoding', description: 'Encoding scheme', type: 'string', optional: true },
559
+ {
560
+ name: 'value',
561
+ description: 'Value to encode; the empty string encodes to the empty string',
562
+ type: 'string',
563
+ },
564
+ {
565
+ name: 'encoding',
566
+ description:
567
+ 'Name of the character encoding applied before encoding; any encoding name the platform recognises works, and an unrecognised or empty name aborts the page',
568
+ type: 'string',
569
+ enum: ['UTF-8', 'UTF-16', 'UTF-16BE', 'UTF-32', 'ASCII', 'ISO-8859-1'],
570
+ optional: true,
571
+ default: 'UTF-8',
572
+ },
425
573
  ],
426
574
  returnType: 'string',
427
- returnDescription: 'The Base64-encoded representation of the input.',
575
+ returnDescription:
576
+ 'The Base64-encoded representation of the input, padded with = to a multiple of four characters.',
428
577
  syntax: 'Base64Encode(value[, encoding])',
429
578
  example: "%%=Base64Encode('Hello')=%%",
579
+ isConfirmed: true,
580
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/base64encode/',
430
581
  },
431
582
  {
432
583
  name: 'BeginImpressionRegion',
@@ -505,10 +656,12 @@ export const FUNCTIONS = [
505
656
  {
506
657
  name: 'BuildRowsetFromJSON',
507
658
  mcnSince: 67,
508
- handlebarsEquivalent: null,
659
+ handlebarsEquivalent: 'jsonPath',
660
+ handlebarsExact: false,
509
661
  mcnNotes: null,
510
662
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-content/mc-ampscript-reference-content-build-rowset-from-json.html',
511
663
  guideUrl: 'https://ampscript.guide/buildrowsetfromjson/',
664
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/buildrowsetfromjson/',
512
665
  minArgs: 3,
513
666
  maxArgs: 3,
514
667
  category: 'Content',
@@ -531,14 +684,19 @@ export const FUNCTIONS = [
531
684
  mcnSince: null,
532
685
  mcnNotes: null,
533
686
  description:
534
- 'If false, return an empty rowset on a syntax error; if true, raise an exception',
535
- type: 'boolean',
687
+ 'Pass 1 or true to get an empty rowset when the payload or path cannot be parsed; 0 or false makes the same input abort the page',
688
+ type: 'boolean|number',
536
689
  },
537
690
  ],
538
691
  returnType: 'rowset',
539
- returnDescription: 'A rowset built from the matched JSON nodes.',
692
+ returnDescription:
693
+ 'A rowset built from the matched JSON nodes. A path that matches nothing yields a rowset with zero rows rather than an error.',
540
694
  syntax: 'BuildRowsetFromJSON(jsonData, jsonPathExpression, returnEmptyOnError)',
541
695
  example: "%%[ SET @rows = BuildRowsetFromJSON(@json, '$.items[*]', 1) ]%%",
696
+ isConfirmed: true,
697
+ differsFromOfficialDocs: true,
698
+ officialDocsNote:
699
+ 'The official syntax section states that a false third argument yields an empty rowset and a true one raises an exception; runtime on the child BU (MID 518005426, CloudPage GET) does the opposite. Malformed JSON with 1 rendered a rowset of zero rows, while the identical payload with 0 aborted the page with HTTP 422. The same page also proved that an unparsable payload, an unset variable, an empty string, [] and a path matching nothing all yield zero rows when 1 is passed. Note the official Errors section already describes the runtime ordering, so the page contradicts itself.',
542
700
  },
543
701
  {
544
702
  name: 'BuildRowSetFromString',
@@ -547,6 +705,7 @@ export const FUNCTIONS = [
547
705
  mcnNotes: null,
548
706
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-content/mc-ampscript-reference-content-build-rowset-from-string.html',
549
707
  guideUrl: 'https://ampscript.guide/buildrowsetfromstring/',
708
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/buildrowsetfromstring/',
550
709
  minArgs: 2,
551
710
  maxArgs: 2,
552
711
  category: 'Content',
@@ -559,15 +718,18 @@ export const FUNCTIONS = [
559
718
  },
560
719
  {
561
720
  name: 'delimiter',
562
- description: 'The character used as a delimiter in the source data',
721
+ description:
722
+ 'The separator to split on; it may be several characters long, and an empty separator leaves the input as a single row',
563
723
  type: 'string',
564
724
  },
565
725
  ],
566
726
  returnType: 'rowset',
567
727
  returnDescription:
568
- 'A rowset where each row holds one delimited segment of the input string.',
728
+ 'A rowset where each row holds one delimited segment of the input string. The single column has no name, so read it with Field(row, 1). An empty or unset input gives zero rows.',
569
729
  syntax: 'BuildRowSetFromString(sourceData, delimiter)',
570
730
  example: "%%=BuildRowSetFromString('a,b,c', ',')=%%",
731
+ isConfirmed: true,
732
+ differsFromOfficialDocs: false,
571
733
  },
572
734
  {
573
735
  name: 'BuildRowSetFromXML',
@@ -576,6 +738,7 @@ export const FUNCTIONS = [
576
738
  mcnNotes: null,
577
739
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-content/mc-ampscript-reference-content-build-rowset-from-xml.html',
578
740
  guideUrl: 'https://ampscript.guide/buildrowsetfromxml/',
741
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/buildrowsetfromxml/',
579
742
  minArgs: 3,
580
743
  maxArgs: 3,
581
744
  category: 'Content',
@@ -592,41 +755,56 @@ export const FUNCTIONS = [
592
755
  mcnSince: null,
593
756
  mcnNotes: null,
594
757
  description:
595
- 'If false, return an empty rowset on a syntax error; if true, raise an exception',
596
- type: 'boolean',
758
+ 'Pass 1 or true to get an empty rowset when the payload or path cannot be parsed; 0 or false makes the same input abort the page',
759
+ type: 'boolean|number',
597
760
  },
598
761
  ],
599
762
  returnType: 'rowset',
600
- returnDescription: 'A rowset built from the matched XML nodes.',
763
+ returnDescription:
764
+ 'A rowset built from the matched XML nodes, with a Value column, an Xml column holding the inner markup, and one <attribute>_att column per attribute seen on any matched node. An XPath that matches nothing yields zero rows rather than an error.',
601
765
  syntax: 'BuildRowSetFromXML(xmlData, xpathExpression, returnEmptyOnError)',
602
766
  example: "%%[ SET @rows = BuildRowSetFromXML(@xml, '/root/item', 1) ]%%",
767
+ isConfirmed: true,
768
+ differsFromOfficialDocs: true,
769
+ officialDocsNote:
770
+ 'The official syntax section states that a false third argument yields an empty rowset and a true one raises an exception; runtime on the child BU (MID 518005426, CloudPage GET) behaves the other way round. Unclosed XML parsed with 1 rendered a rowset of zero rows, whereas the identical payload with 0 aborted the page with HTTP 422. An empty string, an unset variable, an empty root element and an XPath matching nothing likewise gave zero rows under 1.',
603
771
  },
604
772
  {
605
773
  name: 'Char',
606
774
  mcnSince: null,
607
- handlebarsEquivalent: null,
775
+ handlebarsEquivalent: 'char',
776
+ handlebarsExact: true,
608
777
  mcnNotes: null,
609
778
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-string/mc-ampscript-reference-string-char.html',
610
779
  guideUrl: 'https://ampscript.guide/char/',
611
780
  minArgs: 1,
612
781
  maxArgs: 2,
613
782
  category: 'String',
614
- description: 'Returns the character for the given ASCII code.',
783
+ description:
784
+ 'Returns the character for the given numeric character code. Codes above 255 are not rejected — they resolve to the matching Unicode character.',
615
785
  params: [
616
- { name: 'characterCode', description: 'ASCII character code', type: 'number' },
786
+ {
787
+ name: 'characterCode',
788
+ description: 'Character code, as a whole number',
789
+ type: 'string|number',
790
+ },
617
791
  {
618
792
  name: 'numRepetitions',
619
793
  mcnSince: null,
620
794
  mcnNotes: null,
621
- description: 'Number of times to repeat the returned character',
622
- type: 'number',
795
+ description: 'Number of times to repeat the returned character, as a whole number',
796
+ type: 'string|number',
623
797
  optional: true,
624
798
  },
625
799
  ],
626
800
  returnType: 'string',
627
- returnDescription: 'The character that corresponds to the supplied character code.',
801
+ returnDescription:
802
+ 'The character for the supplied code, repeated when a repetition count is given. A count of 0 yields an empty string.',
628
803
  syntax: 'Char(characterCode[, numRepetitions])',
629
804
  example: '%%=Char(10)=%%',
805
+ isConfirmed: true,
806
+ differsFromOfficialDocs: false,
807
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/char/',
630
808
  },
631
809
  {
632
810
  name: 'ClaimRow',
@@ -765,7 +943,10 @@ export const FUNCTIONS = [
765
943
  maxArgs: INF,
766
944
  category: 'Utility',
767
945
  description:
768
- 'Generates a secure, encrypted URL to a CloudPages landing page, optionally passing name-value parameters.',
946
+ 'Builds the published URL of a CloudPages landing page. Name-value pairs are appended in PAIRS and are folded into a single encrypted query token rather than readable parameters; an odd trailing argument or a page ID that matches no page aborts the page.',
947
+ isConfirmed: true,
948
+ differsFromOfficialDocs: false,
949
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/cloudpagesurl/',
769
950
  params: [
770
951
  {
771
952
  name: 'pageId',
@@ -799,7 +980,7 @@ export const FUNCTIONS = [
799
980
  ],
800
981
  returnType: 'string',
801
982
  returnDescription:
802
- 'A tracked URL to the referenced CloudPage, including any passed parameters.',
983
+ 'The page URL. With no extra pairs it is the bare published URL; with pairs it carries one encrypted query token that changes on every call, so the result must never be compared or cached.',
803
984
  repeat: [{ startIndex: 1, groupSize: 2, minGroups: 0 }],
804
985
  syntax: 'CloudPagesURL(pageId[, paramName1, paramValue1, paramNameN, paramValueN, ...])',
805
986
  example: "%%=CloudPagesURL(123, 'key', 'value')=%%",
@@ -808,21 +989,35 @@ export const FUNCTIONS = [
808
989
  name: 'Concat',
809
990
  mcnSince: 67,
810
991
  handlebarsEquivalent: 'concat',
992
+ handlebarsExact: true,
811
993
  mcnNotes: null,
812
994
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-string/mc-ampscript-reference-string-concat.html',
813
995
  guideUrl: 'https://ampscript.guide/concat/',
814
- minArgs: 2,
996
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/concat/',
997
+ minArgs: 1,
815
998
  maxArgs: INF,
999
+ isConfirmed: true,
1000
+ differsFromOfficialDocs: false,
816
1001
  category: 'String',
817
1002
  description: 'Concatenates two or more string values.',
818
1003
  params: [
819
- { name: 'string1', description: 'First string', type: 'string' },
820
- { name: 'string2', description: 'Second string', type: 'string' },
821
- { name: 'stringN', description: 'Additional string', type: 'string', optional: true },
1004
+ { name: 'string1', description: 'First string', type: 'string|number|date' },
1005
+ {
1006
+ name: 'string2',
1007
+ description: 'Second string',
1008
+ type: 'string|number|date',
1009
+ optional: true,
1010
+ },
1011
+ {
1012
+ name: 'stringN',
1013
+ description: 'Additional string',
1014
+ type: 'string|number|date',
1015
+ optional: true,
1016
+ },
822
1017
  ],
823
1018
  returnType: 'string',
824
1019
  returnDescription: 'The concatenation of all supplied values as a single string.',
825
- repeat: [{ startIndex: 0, groupSize: 1, minGroups: 2 }],
1020
+ repeat: [{ startIndex: 0, groupSize: 1, minGroups: 1 }],
826
1021
  syntax: 'Concat(string1, string2[, stringN, ...])',
827
1022
  example: "%%=Concat('Hello', ' ', 'World')=%%",
828
1023
  },
@@ -956,7 +1151,6 @@ export const FUNCTIONS = [
956
1151
  name: 'ContentBlockByID',
957
1152
  mcnSince: 67,
958
1153
  handlebarsEquivalent: null,
959
- mcnHandlebarsGap: true,
960
1154
  mcnNotes: null,
961
1155
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-content/mc-ampscript-reference-content-block-by-id.html',
962
1156
  guideUrl: 'https://ampscript.guide/contentblockbyid/',
@@ -1015,8 +1209,8 @@ export const FUNCTIONS = [
1015
1209
  {
1016
1210
  name: 'ContentBlockByKey',
1017
1211
  mcnSince: 67,
1018
- handlebarsEquivalent: null,
1019
- mcnHandlebarsGap: true,
1212
+ handlebarsEquivalent: 'getContentBlock',
1213
+ handlebarsExact: false,
1020
1214
  mcnNotes: null,
1021
1215
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-content/mc-ampscript-reference-content-block-by-key.html',
1022
1216
  guideUrl: 'https://ampscript.guide/contentblockbykey/',
@@ -1076,7 +1270,6 @@ export const FUNCTIONS = [
1076
1270
  name: 'ContentBlockByName',
1077
1271
  mcnSince: 67,
1078
1272
  handlebarsEquivalent: null,
1079
- mcnHandlebarsGap: true,
1080
1273
  mcnNotes: null,
1081
1274
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-content/mc-ampscript-reference-content-block-by-name.html',
1082
1275
  guideUrl: 'https://ampscript.guide/contentblockbyname/',
@@ -1357,25 +1550,41 @@ export const FUNCTIONS = [
1357
1550
  name: 'DateAdd',
1358
1551
  mcnSince: 67,
1359
1552
  handlebarsEquivalent: 'dateAdd',
1553
+ handlebarsExact: true,
1360
1554
  mcnNotes: null,
1361
1555
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-date-time/mc-ampscript-reference-date-time-date-add.html',
1362
1556
  guideUrl: 'https://ampscript.guide/dateadd/',
1557
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/dateadd/',
1558
+ isConfirmed: true,
1559
+ differsFromOfficialDocs: false,
1363
1560
  minArgs: 3,
1364
1561
  maxArgs: 3,
1365
1562
  category: 'Date and Time',
1366
- description: 'Adds a specified interval to a date value.',
1563
+ description:
1564
+ 'Adds a whole number of intervals to a date value. Only the five documented units are accepted and every other unit, including seconds and weeks, aborts the page — as does a non-integer amount or a date the engine cannot parse.',
1367
1565
  params: [
1368
- { name: 'date', description: 'Base date', type: 'date' },
1369
- { name: 'amountToAdd', description: 'Number of intervals to add', type: 'number' },
1566
+ {
1567
+ name: 'date',
1568
+ description:
1569
+ 'The date to adjust, either a real date value or a parseable date string',
1570
+ type: 'string|date',
1571
+ },
1572
+ {
1573
+ name: 'amountToAdd',
1574
+ description:
1575
+ 'Whole number of intervals to add; negative subtracts, zero returns the date unchanged, and a decimal aborts the page',
1576
+ type: 'string|number',
1577
+ },
1370
1578
  {
1371
1579
  name: 'unitToAdd',
1372
1580
  description:
1373
- 'The unit of the time value being added to the date. Accepted values: Y (years), M (months), D (days), H (hours), and MI (minutes)',
1581
+ 'The unit to add, case-insensitive. Accepted values: Y (years), M (months), D (days), H (hours), MI (minutes). Any other value aborts the page',
1374
1582
  type: 'string',
1375
1583
  },
1376
1584
  ],
1377
1585
  returnType: 'date',
1378
- returnDescription: 'The resulting date after the interval is added.',
1586
+ returnDescription:
1587
+ 'The resulting date value, which the other date functions accept directly. Adding months clamps to the last day of the shorter target month.',
1379
1588
  syntax: 'DateAdd(date, amountToAdd, unitToAdd)',
1380
1589
  example: "%%=DateAdd(Now(), 7, 'D')=%%",
1381
1590
  },
@@ -1383,36 +1592,44 @@ export const FUNCTIONS = [
1383
1592
  name: 'DateDiff',
1384
1593
  mcnSince: 67,
1385
1594
  handlebarsEquivalent: 'dateDiff',
1595
+ handlebarsExact: true,
1386
1596
  mcnNotes: null,
1387
1597
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-date-time/mc-ampscript-reference-date-time-date-diff.html',
1388
1598
  guideUrl: 'https://ampscript.guide/datediff/',
1389
1599
  minArgs: 3,
1390
1600
  maxArgs: 3,
1391
1601
  category: 'Date and Time',
1392
- description: 'Returns the difference between two dates in the specified interval.',
1602
+ description:
1603
+ 'Counts how many boundaries of the requested unit lie between two dates, by truncating both to that unit and subtracting — so a 23-hour gap that crosses midnight counts as 1 day, while 23 hours within one day counts as 0. Finer units than the one requested are ignored rather than rounded.',
1393
1604
  params: [
1394
1605
  {
1395
1606
  name: 'startDate',
1396
- description: 'The starting date for the comparison',
1397
- type: 'date',
1607
+ description:
1608
+ 'The starting date, either a real date value or a parseable date string',
1609
+ type: 'string|date',
1398
1610
  },
1399
1611
  {
1400
1612
  name: 'endDate',
1401
- description: 'The end date; the function subtracts startDate from endDate',
1402
- type: 'date',
1613
+ description:
1614
+ 'The end date, either a real date value or a parseable date string; a later end date gives a positive result and an earlier one a negative result',
1615
+ type: 'string|date',
1403
1616
  },
1404
1617
  {
1405
1618
  name: 'unitOfDifference',
1406
- description: 'Unit of time difference to return',
1619
+ description:
1620
+ 'The unit to count in, case-insensitive. Accepted values: Y (years), M (months), D (days), H (hours), MI (minutes). Any other value aborts the page',
1407
1621
  type: 'string',
1408
1622
  enum: ['Y', 'M', 'D', 'H', 'MI'],
1409
1623
  },
1410
1624
  ],
1411
1625
  returnType: 'number',
1412
1626
  returnDescription:
1413
- 'The whole-number difference between the two dates in the requested unit.',
1627
+ 'A whole number that is negative when the end date precedes the start date and 0 when both fall inside the same unit.',
1414
1628
  syntax: 'DateDiff(startDate, endDate, unitOfDifference)',
1415
1629
  example: "%%=DateDiff(Now(), DateAdd(Now(), 1, 'D'), 'MI')=%%",
1630
+ isConfirmed: true,
1631
+ differsFromOfficialDocs: false,
1632
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/datediff/',
1416
1633
  },
1417
1634
  {
1418
1635
  name: 'DateParse',
@@ -1424,26 +1641,32 @@ export const FUNCTIONS = [
1424
1641
  minArgs: 1,
1425
1642
  maxArgs: 2,
1426
1643
  category: 'Date and Time',
1427
- description: 'Parses a date string into a date value.',
1644
+ description:
1645
+ 'Parses a date string into a date value. A string the parser cannot read aborts the page instead of returning a sentinel, and an ambiguous day-first string such as 5/8/2026 is silently read month-first rather than rejected. An offset or GMT marker in the input is honoured and converted to the account time zone.',
1646
+ isConfirmed: true,
1647
+ differsFromOfficialDocs: false,
1648
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/dateparse/',
1428
1649
  params: [
1429
1650
  {
1430
1651
  name: 'dateString',
1431
- description: 'A string that contains a date or timestamp',
1432
- type: 'string',
1652
+ description:
1653
+ 'A date or timestamp string, or an existing date value; anything the parser cannot read aborts the page',
1654
+ type: 'string|date',
1433
1655
  },
1434
1656
  {
1435
1657
  name: 'useUtc',
1436
1658
  mcnSince: null,
1437
1659
  mcnNotes: null,
1438
1660
  description:
1439
- 'If true, return the date and time in UTC; if false, use the Business Unit local time',
1440
- type: 'boolean',
1661
+ 'If true, return the instant in UTC; otherwise in the account time zone. Accepts 1/0, true/false, or those spellings quoted, and is not validated',
1662
+ type: 'string|boolean|number',
1441
1663
  optional: true,
1442
1664
  default: false,
1443
1665
  },
1444
1666
  ],
1445
1667
  returnType: 'date',
1446
- returnDescription: 'The parsed date value.',
1668
+ returnDescription:
1669
+ 'A real date value the other date functions accept directly. Rendered on its own it prints as a US short date followed by a 12-hour clock with an AM/PM suffix.',
1447
1670
  syntax: 'DateParse(dateString[, useUtc])',
1448
1671
  example: "%%=DateParse('2026-01-15T08:30:00', 1)=%%",
1449
1672
  },
@@ -1457,18 +1680,24 @@ export const FUNCTIONS = [
1457
1680
  minArgs: 2,
1458
1681
  maxArgs: 2,
1459
1682
  category: 'Date and Time',
1460
- description: 'Extracts a specific component from a date value.',
1683
+ description:
1684
+ 'Extracts one component from a date. The hour is reported on a 12-hour clock with no AM/PM indicator, so 19:35 yields 7 and any time at midnight — including a date with no time part at all — yields 12. Month and day come back zero-padded to two digits while hour and minute do not.',
1685
+ isConfirmed: true,
1686
+ differsFromOfficialDocs: false,
1687
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/datepart/',
1461
1688
  params: [
1462
1689
  {
1463
1690
  name: 'dateString',
1464
- description: 'A string that contains a date or timestamp',
1465
- type: 'string',
1691
+ description:
1692
+ 'A real date value or a parseable date string; an unreadable or empty value aborts the page',
1693
+ type: 'string|date',
1466
1694
  },
1467
1695
  {
1468
1696
  name: 'datePart',
1469
1697
  mcnSince: null,
1470
1698
  mcnNotes: null,
1471
- description: 'The date part to extract from the string',
1699
+ description:
1700
+ 'The component to extract, case-insensitive. Any other value aborts the page',
1472
1701
  type: 'string',
1473
1702
  enum: [
1474
1703
  'year',
@@ -1487,7 +1716,7 @@ export const FUNCTIONS = [
1487
1716
  ],
1488
1717
  returnType: 'string',
1489
1718
  returnDescription:
1490
- 'The requested component of the date. Most parts return a numeric value as a string; `monthName` returns the full month name as text.',
1719
+ 'The requested component as text — a zero-padded two-digit month or day, an unpadded hour or minute, a four-digit year, or the full English month name. Numeric components still feed the math functions directly.',
1491
1720
  syntax: 'DatePart(dateString, datePart)',
1492
1721
  example: "%%=DatePart('2026-01-15', 'Y')=%%",
1493
1722
  },
@@ -1501,10 +1730,23 @@ export const FUNCTIONS = [
1501
1730
  minArgs: 8,
1502
1731
  maxArgs: 8,
1503
1732
  category: 'Encryption and Encoding',
1504
- description: 'Decrypts a value using symmetric key encryption.',
1733
+ isConfirmed: true,
1734
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/decryptsymmetric/',
1735
+ description:
1736
+ 'Decrypts a Base64 ciphertext produced by EncryptSymmetric, using the same algorithm, passphrase, salt and initialization vector.',
1505
1737
  params: [
1506
- { name: 'encryptedValue', description: 'Value to decrypt', type: 'string' },
1507
- { name: 'algorithm', description: 'Encryption algorithm (e.g. AES)', type: 'string' },
1738
+ {
1739
+ name: 'encryptedValue',
1740
+ description: 'Base64 ciphertext to decrypt',
1741
+ type: 'string',
1742
+ },
1743
+ {
1744
+ name: 'algorithm',
1745
+ description:
1746
+ 'Cipher name, optionally followed by semicolon-separated mode and padding settings; must match the settings used to encrypt, and an unrecognised name aborts the page',
1747
+ type: 'string',
1748
+ enum: ['aes', 'des', 'tripledes'],
1749
+ },
1508
1750
  {
1509
1751
  name: 'passwordExternalKey',
1510
1752
  mcnSince: null,
@@ -1667,21 +1909,26 @@ export const FUNCTIONS = [
1667
1909
  name: 'Divide',
1668
1910
  mcnSince: 67,
1669
1911
  handlebarsEquivalent: 'divide',
1912
+ handlebarsExact: true,
1670
1913
  mcnNotes: null,
1671
1914
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-math/mc-ampscript-reference-math-divide.html',
1672
1915
  guideUrl: 'https://ampscript.guide/divide/',
1916
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/divide/',
1673
1917
  minArgs: 2,
1674
1918
  maxArgs: 2,
1675
1919
  category: 'Math',
1676
1920
  description: 'Divides the first number by the second.',
1677
1921
  params: [
1678
- { name: 'dividend', description: 'Number to divide', type: 'number' },
1679
- { name: 'divisor', description: 'Number to divide by', type: 'number' },
1922
+ { name: 'dividend', description: 'Number to divide', type: 'string|number' },
1923
+ { name: 'divisor', description: 'Number to divide by', type: 'string|number' },
1680
1924
  ],
1681
1925
  returnType: 'number',
1682
- returnDescription: 'The quotient of the two operands.',
1926
+ returnDescription:
1927
+ 'The quotient of the two operands. A zero divisor does not raise an error: a non-zero dividend yields the infinity symbol and a zero dividend yields NaN, so guard against a zero divisor before rendering the result.',
1683
1928
  syntax: 'Divide(dividend, divisor)',
1684
1929
  example: '%%=Divide(100, 4)=%%',
1930
+ isConfirmed: true,
1931
+ differsFromOfficialDocs: false,
1685
1932
  },
1686
1933
  {
1687
1934
  name: 'Domain',
@@ -1690,13 +1937,24 @@ export const FUNCTIONS = [
1690
1937
  mcnNotes: null,
1691
1938
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-utilities/mc-ampscript-reference-utilities-domain.html',
1692
1939
  guideUrl: 'https://ampscript.guide/domain/',
1940
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/domain/',
1693
1941
  minArgs: 1,
1694
1942
  maxArgs: 1,
1943
+ isConfirmed: true,
1944
+ differsFromOfficialDocs: false,
1695
1945
  category: 'Utility',
1696
- description: 'Extracts the domain portion from an email address.',
1697
- params: [{ name: 'emailAddress', description: 'Email address', type: 'string' }],
1946
+ description:
1947
+ 'Returns everything after the first at sign, without validating the address or the domain. A value with no at sign, an empty string and a number all return an empty string.',
1948
+ params: [
1949
+ {
1950
+ name: 'emailAddress',
1951
+ description: 'Email address; the text after the first at sign is returned verbatim',
1952
+ type: 'string',
1953
+ },
1954
+ ],
1698
1955
  returnType: 'string',
1699
- returnDescription: 'The domain portion of the supplied email address.',
1956
+ returnDescription:
1957
+ 'The text following the first at sign, preserving the original case and any further at signs. Empty when the value contains no at sign or nothing follows it.',
1700
1958
  syntax: 'Domain(emailAddress)',
1701
1959
  example: "%%=Domain('user@example.com')=%%",
1702
1960
  },
@@ -1704,17 +1962,28 @@ export const FUNCTIONS = [
1704
1962
  name: 'Empty',
1705
1963
  mcnSince: 67,
1706
1964
  handlebarsEquivalent: 'isEmpty',
1965
+ handlebarsExact: true,
1707
1966
  mcnNotes: null,
1708
1967
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-utilities/mc-ampscript-reference-utilities-empty.html',
1709
1968
  guideUrl: 'https://ampscript.guide/empty/',
1969
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/empty/',
1710
1970
  minArgs: 1,
1711
1971
  maxArgs: 1,
1712
1972
  category: 'Utility',
1713
- description: 'Returns true if the value is empty, null, or not defined.',
1714
- params: [{ name: 'value', description: 'Value to test' }],
1973
+ description:
1974
+ 'Returns true when the value is an empty string, an unset variable, or an undeclared variable. Whitespace, the number 0, the string "0" and the string "false" are all treated as present.',
1975
+ params: [
1976
+ {
1977
+ name: 'value',
1978
+ description:
1979
+ 'Value to test; a variable, literal, attribute or nested function call is accepted',
1980
+ type: 'string|number|boolean|date',
1981
+ },
1982
+ ],
1715
1983
  returnType: 'boolean',
1716
- returnDescription: 'True when the value is empty or null, otherwise false.',
1984
+ returnDescription: 'True when the value is empty or missing, otherwise false.',
1717
1985
  returnEnum: [true, false],
1986
+ isConfirmed: true,
1718
1987
  syntax: 'Empty(value)',
1719
1988
  example: '%%=Empty(@myVar)=%%',
1720
1989
  },
@@ -1728,10 +1997,19 @@ export const FUNCTIONS = [
1728
1997
  minArgs: 8,
1729
1998
  maxArgs: 8,
1730
1999
  category: 'Encryption and Encoding',
1731
- description: 'Encrypts a value using symmetric key encryption.',
2000
+ isConfirmed: true,
2001
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/encryptsymmetric/',
2002
+ description:
2003
+ 'Encrypts a value using symmetric key encryption and returns the ciphertext as Base64. The result is deterministic: the same inputs produce the same ciphertext on every call.',
1732
2004
  params: [
1733
2005
  { name: 'value', description: 'Value to encrypt', type: 'string' },
1734
- { name: 'algorithm', description: 'Encryption algorithm (e.g. AES)', type: 'string' },
2006
+ {
2007
+ name: 'algorithm',
2008
+ description:
2009
+ 'Cipher name, optionally followed by semicolon-separated mode and padding settings such as des;mode=ecb;padding=zeros; an unrecognised name aborts the page',
2010
+ type: 'string',
2011
+ enum: ['aes', 'des', 'tripledes'],
2012
+ },
1735
2013
  {
1736
2014
  name: 'passwordExternalKey',
1737
2015
  mcnSince: null,
@@ -1764,7 +2042,7 @@ export const FUNCTIONS = [
1764
2042
  { name: 'iv', description: 'IV value or empty to use external key', type: 'string' },
1765
2043
  ],
1766
2044
  returnType: 'string',
1767
- returnDescription: 'The encrypted value.',
2045
+ returnDescription: 'The ciphertext, Base64-encoded.',
1768
2046
  syntax: 'EncryptSymmetric(value, algorithm, passwordExternalKey, password, saltExternalKey, salt, ivExternalKey, iv)',
1769
2047
  example: "%%=EncryptSymmetric('secret', 'aes', 'pwKey', '', 'saltKey', '', 'ivKey', '')=%%",
1770
2048
  },
@@ -1878,7 +2156,8 @@ export const FUNCTIONS = [
1878
2156
  {
1879
2157
  name: 'Field',
1880
2158
  mcnSince: 67,
1881
- handlebarsEquivalent: null,
2159
+ handlebarsEquivalent: 'get',
2160
+ handlebarsExact: false,
1882
2161
  mcnNotes: null,
1883
2162
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-data-extension/mc-ampscript-reference-data-extension-field.html',
1884
2163
  guideUrl: 'https://ampscript.guide/field/',
@@ -1909,52 +2188,92 @@ export const FUNCTIONS = [
1909
2188
  name: 'Format',
1910
2189
  mcnSince: 67,
1911
2190
  handlebarsEquivalent: 'format',
2191
+ handlebarsExact: false,
1912
2192
  mcnNotes: null,
1913
2193
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-string/mc-ampscript-reference-string-format.html',
1914
2194
  guideUrl: 'https://ampscript.guide/format/',
1915
2195
  minArgs: 2,
1916
2196
  maxArgs: 4,
1917
2197
  category: 'Utility',
1918
- description: 'Formats a value using a .NET format string.',
2198
+ isConfirmed: true,
2199
+ differsFromOfficialDocs: true,
2200
+ officialDocsNote:
2201
+ 'Proven on the child BU MCDEV_Training_QA (MID 518005426). The official reference names two possible values for the third parameter, Date and Number, but at runtime only Date is usable. Passing the literal Number aborts the page with HTTP 422 and discards all output, whether or not a locale follows it — Format(1234.555, "C2", "Number") and Format(1234.555, "C2", "Number", "de-DE") both aborted, exactly like the invented value Banana. Date works in any capitalisation, and the empty string works and still allows a locale in the fourth parameter, so Format(1234.555, "C2", "", "de-DE") is the way to format a localised number. Number formatting also happens correctly with the third parameter omitted entirely, so the documented value is not merely optional, it is unusable.',
2202
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/format/',
2203
+ description:
2204
+ 'Formats a number, a date or a string with a .NET format pattern. The third parameter only accepts Date or the empty string; the documented value Number aborts the page.',
1919
2205
  params: [
1920
- { name: 'value', description: 'Value to format' },
1921
- { name: 'formatString', description: '.NET format string', type: 'string' },
1922
2206
  {
1923
- name: 'culture',
2207
+ name: 'value',
2208
+ description:
2209
+ 'The value to format; a number, a numeric string, a date value or a parseable date string',
2210
+ type: 'string|number|date',
2211
+ },
2212
+ {
2213
+ name: 'formatString',
2214
+ description:
2215
+ 'Standard or custom .NET format pattern; an unusable pattern is echoed back instead of failing',
2216
+ type: 'string',
2217
+ },
2218
+ {
2219
+ name: 'dataFormat',
1924
2220
  mcnSince: null,
1925
2221
  mcnNotes: null,
1926
- description: 'Culture code (e.g. en-US)',
2222
+ description:
2223
+ 'Only Date, in any capitalisation, or the empty string; any other value including the documented Number aborts the page',
2224
+ type: 'string',
2225
+ optional: true,
2226
+ },
2227
+ {
2228
+ name: 'cultureCode',
2229
+ description:
2230
+ 'The locale for separators, symbols and month and day names, written with either a hyphen or an underscore',
1927
2231
  type: 'string',
1928
2232
  optional: true,
1929
2233
  },
1930
- { name: 'timeZone', description: 'Target time zone', type: 'string', optional: true },
1931
2234
  ],
1932
2235
  returnType: 'string',
1933
- returnDescription: 'The formatted string representation of the value.',
1934
- syntax: 'Format(value, formatString[, culture, timeZone])',
1935
- example: "%%=Format('2026-01-15', 'dd.MM.yyyy')=%%",
2236
+ returnDescription:
2237
+ 'The formatted value, or an unformatted echo of the input or of the pattern when the pattern does not suit the input.',
2238
+ syntax: 'Format(value, formatString[, dataFormat, cultureCode])',
2239
+ example: '%%=Format("2026-03-04 13:52:07", "yyyy-MM-dd HH:mm:ss", "Date")=%%',
1936
2240
  },
1937
2241
  {
1938
2242
  name: 'FormatCurrency',
1939
2243
  mcnSince: 67,
1940
2244
  handlebarsEquivalent: 'formatCurrency',
2245
+ handlebarsExact: false,
1941
2246
  mcnNotes: null,
1942
2247
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-utilities/mc-ampscript-reference-utilities-formatCurrency.html',
1943
2248
  guideUrl: 'https://ampscript.guide/formatcurrency/',
1944
2249
  minArgs: 2,
1945
2250
  maxArgs: 4,
1946
2251
  category: 'Utility',
1947
- description: 'Formats a number as a currency string.',
2252
+ isConfirmed: true,
2253
+ differsFromOfficialDocs: false,
2254
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/formatcurrency/',
2255
+ description:
2256
+ 'Formats a number as a currency amount for a locale, choosing the symbol, the separators and the symbol position from that locale. Rounding is half-up.',
1948
2257
  params: [
1949
- { name: 'value', description: 'Numeric value', type: 'number' },
1950
- { name: 'locale', description: 'Locale code (e.g. en-US)', type: 'string' },
2258
+ {
2259
+ name: 'value',
2260
+ description:
2261
+ 'The amount to format, as a number or as a numeric string; a string may carry thousands separators',
2262
+ type: 'string|number',
2263
+ },
2264
+ {
2265
+ name: 'locale',
2266
+ description:
2267
+ 'The locale that supplies the symbol, the separators and the symbol position, written with either a hyphen or an underscore; a language-only code works and an unknown code falls back to a generic currency sign',
2268
+ type: 'string',
2269
+ },
1951
2270
  {
1952
2271
  name: 'decimalPlaces',
1953
2272
  mcnSince: null,
1954
2273
  mcnNotes: null,
1955
2274
  description:
1956
- 'Number of decimal places; defaults to 2 when omitted (locale-dependent rounding may apply)',
1957
- type: 'number',
2275
+ 'Number of decimal places; without it the locale decides, which is zero places for currencies that have no minor unit',
2276
+ type: 'string|number',
1958
2277
  optional: true,
1959
2278
  default: 2,
1960
2279
  },
@@ -1962,20 +2281,22 @@ export const FUNCTIONS = [
1962
2281
  name: 'symbol',
1963
2282
  mcnSince: null,
1964
2283
  mcnNotes: null,
1965
- description: 'Custom currency symbol',
2284
+ description:
2285
+ "Replaces the locale's currency symbol while keeping the locale's separators and symbol position; requires decimalPlaces to be supplied as well",
1966
2286
  type: 'string',
1967
2287
  optional: true,
1968
2288
  },
1969
2289
  ],
1970
2290
  returnType: 'string',
1971
- returnDescription: 'The value formatted as a localized currency string.',
2291
+ returnDescription: 'The amount formatted as a currency string for the requested locale.',
1972
2292
  syntax: 'FormatCurrency(value, locale[, decimalPlaces, symbol])',
1973
- example: "%%=FormatCurrency(1234.5, 'en-US', 2, '$')=%%",
2293
+ example: "%%=FormatCurrency(1234.555, 'en-US')=%%",
1974
2294
  },
1975
2295
  {
1976
2296
  name: 'FormatDate',
1977
2297
  mcnSince: 67,
1978
- handlebarsEquivalent: null,
2298
+ handlebarsEquivalent: 'format',
2299
+ handlebarsExact: false,
1979
2300
  mcnNotes:
1980
2301
  'In MCN, uses Java SimpleDateFormat format strings instead of .NET. Omitting dateFormat returns the G standard format (e.g. "5/15/2026 1:23:45 PM").',
1981
2302
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-date-time/mc-ampscript-reference-date-time-format-date.html',
@@ -1983,37 +2304,47 @@ export const FUNCTIONS = [
1983
2304
  minArgs: 1,
1984
2305
  maxArgs: 4,
1985
2306
  category: 'Date and Time',
2307
+ isConfirmed: true,
2308
+ differsFromOfficialDocs: true,
2309
+ officialDocsNote:
2310
+ 'Proven on the child BU MCDEV_Training_QA (MID 518005426). The official reference presents one .NET-style custom-pattern table and shows it applied to the dateFormat argument, but at runtime the two format arguments use SEPARATE, case-INSENSITIVE token sets. In dateFormat, mm and MM both render the MONTH, so the documented pattern yyyy-MM-dd HH:mm:ss returned 2026-03-04 13:03:07 for the instant 2026-03-04 13:52:07 — the minutes position printed 03, the month. The same pattern moved to timeFormat returned 13:52:07 correctly, because there mm and MM mean minutes. Single-letter tokens also disagree with the doc: d rendered the whole short date 3/4/2026 rather than the day number, M rendered March 4 rather than 3, and h or H alone in timeFormat aborts the page with HTTP 422 instead of rendering an hour. The day-name tokens are off by one repetition — dddd rendered Wed where the doc promises Wednesday, ddddd rendered Wednesday, and ddd rendered the corrupted string We4ne74a26 in which digits from the date replaced letters of the day name.',
2311
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/formatdate/',
1986
2312
  description:
1987
- 'Formats a date string according to the specified date and time format patterns.',
2313
+ 'Formats a date according to a date pattern, a time pattern and a locale. The two pattern arguments use separate, case-insensitive token sets: in the date pattern mm means month, and minutes are only reachable from the time pattern.',
1988
2314
  params: [
1989
2315
  {
1990
2316
  name: 'dateString',
1991
- description: 'The date string that you want to format',
1992
- type: 'string',
2317
+ description:
2318
+ 'The date to format, either a real date value or a parseable date string',
2319
+ type: 'string|date',
1993
2320
  },
1994
2321
  {
1995
2322
  name: 'dateFormat',
1996
2323
  mcnSince: 67,
1997
2324
  mcnNotes: null,
1998
- description: 'A string that represents the format to apply to the date',
2325
+ description:
2326
+ 'The date pattern, or a single-letter standard format such as D, G or s. Case-insensitive, and mm here means month, not minutes',
1999
2327
  type: 'string',
2000
2328
  optional: true,
2001
2329
  },
2002
2330
  {
2003
2331
  name: 'timeFormat',
2004
- description: 'A string that represents the format to apply to the time',
2332
+ description:
2333
+ 'The time pattern. Case-insensitive, and this is the only argument in which mm means minutes',
2005
2334
  type: 'string',
2006
2335
  optional: true,
2007
2336
  },
2008
2337
  {
2009
2338
  name: 'localeCode',
2010
- description: 'The locale code to use when formatting the date',
2339
+ description:
2340
+ 'The locale for month and day names and for the standard formats, written with either a hyphen or an underscore',
2011
2341
  type: 'string',
2012
2342
  optional: true,
2013
2343
  },
2014
2344
  ],
2015
2345
  returnType: 'string',
2016
- returnDescription: 'The date formatted according to the supplied format and locale.',
2346
+ returnDescription:
2347
+ 'The formatted date, or an empty string when the first argument cannot be parsed as a date.',
2017
2348
  syntax: 'FormatDate(dateString[, dateFormat, timeFormat, localeCode])',
2018
2349
  example: '%%=FormatDate(Now(), "dddd, MMMM d yyyy", "HH:mm:ss")=%%',
2019
2350
  },
@@ -2021,22 +2352,43 @@ export const FUNCTIONS = [
2021
2352
  name: 'FormatNumber',
2022
2353
  mcnSince: 67,
2023
2354
  handlebarsEquivalent: 'formatNumber',
2355
+ handlebarsExact: true,
2024
2356
  mcnNotes: null,
2025
2357
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-utilities/mc-ampscript-reference-utilities-formatNumber.html',
2026
2358
  guideUrl: 'https://ampscript.guide/formatnumber/',
2027
2359
  minArgs: 2,
2028
2360
  maxArgs: 3,
2029
2361
  category: 'Utility',
2030
- description: 'Formats a number using a format pattern.',
2362
+ isConfirmed: true,
2363
+ differsFromOfficialDocs: false,
2364
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/formatnumber/',
2365
+ description:
2366
+ 'Formats a number with a standard or custom .NET numeric pattern, optionally for a locale. Rounding is half-up.',
2031
2367
  params: [
2032
- { name: 'number', description: 'Numeric value to format', type: 'number' },
2033
- { name: 'format', description: 'Format pattern (e.g. N2, C0)', type: 'string' },
2034
- { name: 'locale', description: 'Locale code', type: 'string', optional: true },
2368
+ {
2369
+ name: 'number',
2370
+ description:
2371
+ 'The value to format, as a number or as a numeric string; a string may carry thousands separators',
2372
+ type: 'string|number',
2373
+ },
2374
+ {
2375
+ name: 'format',
2376
+ description:
2377
+ 'Standard pattern letter with an optional precision digit, such as N2 or C0, or a custom pattern; an unrecognised pattern is echoed back',
2378
+ type: 'string',
2379
+ },
2380
+ {
2381
+ name: 'locale',
2382
+ description:
2383
+ 'The locale that supplies separators and the currency symbol, written with either a hyphen or an underscore; an unknown code falls back rather than failing',
2384
+ type: 'string',
2385
+ optional: true,
2386
+ },
2035
2387
  ],
2036
2388
  returnType: 'string',
2037
- returnDescription: 'The number formatted according to the supplied format string.',
2389
+ returnDescription: 'The number formatted according to the supplied pattern.',
2038
2390
  syntax: 'FormatNumber(number, format[, locale])',
2039
- example: "%%=FormatNumber(1234.567, 'N2', 'en-US')=%%",
2391
+ example: "%%=FormatNumber(1234.555, 'N2', 'de-DE')=%%",
2040
2392
  },
2041
2393
  {
2042
2394
  name: 'GetJWT',
@@ -2048,24 +2400,34 @@ export const FUNCTIONS = [
2048
2400
  minArgs: 3,
2049
2401
  maxArgs: 3,
2050
2402
  category: 'Encryption and Encoding',
2051
- description: 'Generates a JSON Web Token using the supplied claims, algorithm, and secret.',
2403
+ description:
2404
+ 'Generates a JSON Web Token signed with the supplied inline secret. The payload is passed through verbatim and is only Base64url-encoded, never encrypted.',
2052
2405
  params: [
2053
- { name: 'secret', description: 'Secret key for signing', type: 'string' },
2406
+ {
2407
+ name: 'secret',
2408
+ description:
2409
+ 'Secret used to sign the token; the empty string aborts the page rather than signing with an empty key',
2410
+ type: 'string',
2411
+ },
2054
2412
  {
2055
2413
  name: 'algorithm',
2056
- description: 'Hashing algorithm',
2414
+ description:
2415
+ 'HMAC algorithm name, matched case-insensitively; an unknown name aborts the page',
2057
2416
  type: 'string',
2058
2417
  enum: ['HS256', 'HS384', 'HS512'],
2059
2418
  },
2060
2419
  {
2061
2420
  name: 'jsonPayload',
2062
2421
  description:
2063
- "The payload of the JWT. Typically, the payload is a JSON object with name-value pairs. The JWT payload isn't encrypted.",
2422
+ 'Payload to encode. It is copied into the token untouched and is not validated as JSON, so a non-JSON string is signed just as readily.',
2064
2423
  type: 'string',
2065
2424
  },
2066
2425
  ],
2067
2426
  returnType: 'string',
2068
- returnDescription: 'A signed JSON Web Token string.',
2427
+ returnDescription:
2428
+ 'The token as three Base64url segments joined by dots, with no padding. The same arguments always produce the same token.',
2429
+ isConfirmed: true,
2430
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/getjwt/',
2069
2431
  syntax: 'GetJWT(secret, algorithm, jsonPayload)',
2070
2432
  example: "%%=GetJWT(@secret, 'HS256', @payload)=%%",
2071
2433
  },
@@ -2097,6 +2459,9 @@ export const FUNCTIONS = [
2097
2459
  ],
2098
2460
  returnType: 'string',
2099
2461
  returnDescription: 'A signed JSON Web Token string created with the named key.',
2462
+ isConfirmed: false,
2463
+ verificationBlocked: true,
2464
+ verificationBlockedReason: 'no-test-data',
2100
2465
  syntax: 'GetJWTByKeyName(keyName, algorithm, jsonPayload)',
2101
2466
  example: "%%=GetJWTByKeyName('MyKeyName', 'HS256', @payload)=%%",
2102
2467
  },
@@ -2153,21 +2518,29 @@ export const FUNCTIONS = [
2153
2518
  maxArgs: 1,
2154
2519
  category: 'Date and Time',
2155
2520
  description:
2156
- 'Returns the scheduled send time for the current job. In STO context returns the Einstein-optimized time.',
2521
+ 'Returns a send timestamp: by default the time the send completed for the individual subscriber, or with a true argument the job start or publish time. Outside a send context, such as on a CloudPage, it returns the current system time instead of a send time, in every argument spelling.',
2157
2522
  params: [
2158
2523
  {
2159
- name: 'persistFormat',
2524
+ name: 'boolAllSubscribers',
2160
2525
  mcnSince: null,
2161
2526
  mcnNotes: null,
2162
- description: 'Persist date format flag',
2163
- type: 'boolean',
2527
+ description:
2528
+ 'If true, return the job start or publish time instead of the individual subscriber send-completed time; outside a send context it makes no difference. Accepts 1/0, true/false, or those spellings quoted, and is not validated',
2529
+ type: 'string|boolean|number',
2164
2530
  optional: true,
2165
2531
  },
2166
2532
  ],
2167
2533
  returnType: 'date',
2168
- returnDescription: 'The send time of the message as a date value.',
2169
- syntax: 'GetSendTime([persistFormat])',
2534
+ returnDescription:
2535
+ 'A real date value the other date functions accept directly, in the same system time zone as Now().',
2536
+ syntax: 'GetSendTime([boolAllSubscribers])',
2170
2537
  example: '%%=GetSendTime(1)=%%',
2538
+ isConfirmed: false,
2539
+ verificationBlocked: true,
2540
+ verificationBlockedReason: 'needs-auth-context',
2541
+ differsFromOfficialDocs: false,
2542
+ officialDocsNote:
2543
+ 'Send-context semantics could not be proven: a CloudPage GET has no send, so both documented paths collapse. Probed on the child BU MCDEV_Training_QA (MID 518005426), one deploy and eight gated fetches. GetSendTime() rendered 8/8/2026 7:35:16 PM against Now()=8/8/2026 7:35:16 PM in the same render, with FormatDate(..., "ffffff") giving 507042 for both, so the two are the same instant to the microsecond rather than merely the same second. Every argument spelling (1, 0, true, false, "1", "0", "true", "false", and the non-flag word spring) was accepted at HTTP 200 and returned that same current time, and DateDiff(GetSendTime(1), Now(), "MI") was 0. What IS proven on a CloudPage: the value is a real date (FormatDate gave 2026-08-08, DatePart gave 2026 and 7, DateAdd of three hours advanced it, DateDiff measured that gap as 3), it renders as a US short date plus a 12-hour clock (Length 19 for that instant), Empty() over it is False, it sits on the system side of the clock (DateDiff to SystemDateToLocalDate was 480 minutes, identical to the same measurement over Now()), arity 0 and 1 both work and arity 2 aborts the page with HTTP 422. What is NOT proven and needs a real list, data extension, triggered or journey send: the individual subscriber send-completed time, the job start time, the job publish time and the STO-optimized time.',
2171
2544
  },
2172
2545
  {
2173
2546
  name: 'GetSocialPublishURL',
@@ -2285,15 +2658,20 @@ export const FUNCTIONS = [
2285
2658
  mcnNotes: null,
2286
2659
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-utilities/mc-ampscript-reference-utilities-guid.html',
2287
2660
  guideUrl: 'https://ampscript.guide/guid/',
2661
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/guid/',
2288
2662
  minArgs: 0,
2289
2663
  maxArgs: 0,
2290
2664
  category: 'Utility',
2291
- description: 'Generates a new globally unique identifier (GUID).',
2665
+ description:
2666
+ 'Generates a new globally unique identifier. Every call returns a different value, so store the result in a variable when the same identifier is needed twice.',
2292
2667
  params: [],
2293
2668
  returnType: 'string',
2294
- returnDescription: 'A newly generated globally unique identifier.',
2669
+ returnDescription:
2670
+ 'A 36-character lowercase identifier in the eight-four-four-four-twelve hyphenated form, without surrounding braces.',
2295
2671
  syntax: 'GUID()',
2296
2672
  example: '%%=GUID()=%%',
2673
+ isConfirmed: true,
2674
+ differsFromOfficialDocs: false,
2297
2675
  },
2298
2676
  {
2299
2677
  name: 'HTTPGet',
@@ -2596,21 +2974,38 @@ export const FUNCTIONS = [
2596
2974
  name: 'IIf',
2597
2975
  mcnSince: 67,
2598
2976
  handlebarsEquivalent: 'iif',
2977
+ handlebarsExact: true,
2599
2978
  mcnNotes: null,
2600
2979
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-utilities/mc-ampscript-reference-utilities-iif.html',
2601
2980
  guideUrl: 'https://ampscript.guide/iif/',
2981
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/iif/',
2602
2982
  minArgs: 3,
2603
2983
  maxArgs: 3,
2604
2984
  category: 'Utility',
2605
- description: 'Returns one of two values based on a boolean expression (inline if).',
2985
+ description:
2986
+ 'Returns one of two values based on a boolean expression (inline if). Only a real comparison or a boolean-returning function selects the true branch; a plain string or number always selects the false branch. Only the selected branch is evaluated, so a call that would abort the page is safe in the branch that is not taken.',
2606
2987
  params: [
2607
- { name: 'expression', description: 'Boolean expression to evaluate', type: 'boolean' },
2608
- { name: 'trueValue', description: 'Value returned when true' },
2609
- { name: 'falseValue', description: 'Value returned when false' },
2988
+ {
2989
+ name: 'expression',
2990
+ description:
2991
+ 'Boolean expression to evaluate; a non-boolean value always selects the false branch',
2992
+ type: 'boolean',
2993
+ },
2994
+ {
2995
+ name: 'trueValue',
2996
+ description: 'Value returned when true; evaluated only when true is selected',
2997
+ type: 'string|number|boolean|date',
2998
+ },
2999
+ {
3000
+ name: 'falseValue',
3001
+ description: 'Value returned when false; evaluated only when false is selected',
3002
+ type: 'string|number|boolean|date',
3003
+ },
2610
3004
  ],
2611
3005
  returnType: 'string',
2612
3006
  returnDescription:
2613
3007
  'The second argument when the condition is true, otherwise the third argument.',
3008
+ isConfirmed: true,
2614
3009
  syntax: 'IIf(expression, trueValue, falseValue)',
2615
3010
  example: "%%=IIf(Empty(@name), 'Friend', @name)=%%",
2616
3011
  },
@@ -2652,21 +3047,36 @@ export const FUNCTIONS = [
2652
3047
  name: 'IndexOf',
2653
3048
  mcnSince: 67,
2654
3049
  handlebarsEquivalent: 'indexOf',
3050
+ handlebarsExact: false,
2655
3051
  mcnNotes: null,
2656
3052
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-string/mc-ampscript-reference-string-index-of.html',
2657
3053
  guideUrl: 'https://ampscript.guide/indexof/',
3054
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/indexof/',
2658
3055
  minArgs: 2,
2659
- maxArgs: 2,
3056
+ maxArgs: 3,
2660
3057
  category: 'String',
2661
- description: 'Returns the 1-based position of the first occurrence of a substring.',
3058
+ description:
3059
+ 'Returns the 1-based position of a substring, matching case-insensitively. An undocumented third argument selects which occurrence to locate.',
2662
3060
  params: [
2663
- { name: 'sourceString', description: 'String to search in', type: 'string' },
2664
- { name: 'substring', description: 'Substring to find', type: 'string' },
3061
+ {
3062
+ name: 'sourceString',
3063
+ description: 'String to search in',
3064
+ type: 'string|number',
3065
+ },
3066
+ { name: 'substring', description: 'Substring to find', type: 'string|number' },
3067
+ {
3068
+ name: 'occurrence',
3069
+ description: 'Which occurrence to locate, as a whole number; defaults to the first',
3070
+ type: 'string|number',
3071
+ },
2665
3072
  ],
2666
3073
  returnType: 'number',
2667
- returnDescription: 'The 1-based position of the substring, or 0 when it is not found.',
2668
- syntax: 'IndexOf(sourceString, substring)',
3074
+ returnDescription:
3075
+ 'The 1-based position of the substring, or 0 when it is not found or the requested occurrence does not exist.',
3076
+ syntax: 'IndexOf(sourceString, substring[, occurrence])',
2669
3077
  example: "%%=IndexOf('Hello World', 'World')=%%",
3078
+ isConfirmed: true,
3079
+ differsFromOfficialDocs: false,
2670
3080
  },
2671
3081
  {
2672
3082
  name: 'InsertData',
@@ -2991,12 +3401,22 @@ export const FUNCTIONS = [
2991
3401
  mcnNotes: null,
2992
3402
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-http/mc-ampscript-reference-http-is-chtml-browser.html',
2993
3403
  guideUrl: 'https://ampscript.guide/ischtmlbrowser/',
3404
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/ischtmlbrowser/',
2994
3405
  minArgs: 1,
2995
3406
  maxArgs: 1,
3407
+ isConfirmed: true,
3408
+ differsFromOfficialDocs: false,
2996
3409
  category: 'Utility',
2997
3410
  description:
2998
- "Returns true if the subscriber's browser is identified as a compact HTML (cHTML) device.",
2999
- params: [{ name: 'userAgent', description: 'User agent string to test', type: 'string' }],
3411
+ 'Tests a user agent string for a compact HTML (cHTML) feature-phone browser. Feature-phone agents such as i-mode and KDDI handsets are recognised; modern desktop and mobile agents are not.',
3412
+ params: [
3413
+ {
3414
+ name: 'userAgent',
3415
+ description:
3416
+ 'User agent string to test, typically HTTPRequestHeader("user-agent") on a CloudPage',
3417
+ type: 'string',
3418
+ },
3419
+ ],
3000
3420
  returnType: 'boolean',
3001
3421
  returnDescription: 'True when the user agent indicates a cHTML browser, otherwise false.',
3002
3422
  returnEnum: [true, false],
@@ -3010,11 +3430,24 @@ export const FUNCTIONS = [
3010
3430
  mcnNotes: null,
3011
3431
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-utilities/mc-ampscript-reference-utilities-is-email-address.html',
3012
3432
  guideUrl: 'https://ampscript.guide/isemailaddress/',
3433
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/isemailaddress/',
3013
3434
  minArgs: 1,
3014
3435
  maxArgs: 1,
3436
+ isConfirmed: true,
3437
+ differsFromOfficialDocs: true,
3438
+ officialDocsNote:
3439
+ 'The official reference states that an address whose domain has no top-level domain is accepted, giving a call on a bare single-label domain as an example of a true result. On a live Engagement CloudPage on the child business unit (MID 518005426) that shape returned False, in a gate that printed its own start and done markers at HTTP 200 alongside a known-good control block. Every other example in the same table matched: the missing at sign, the double at sign, the missing local part and the missing second-level domain all returned False, and a well-formed address returned True. Surrounding whitespace is also rejected, which no source mentions.',
3015
3440
  category: 'Utility',
3016
- description: 'Returns true if the value is a syntactically valid email address.',
3017
- params: [{ name: 'value', description: 'Value to validate', type: 'string' }],
3441
+ description:
3442
+ 'Checks a value against email address syntax only; it never tests whether the mailbox or domain exists. Surrounding whitespace and a domain without a top-level domain are both rejected.',
3443
+ params: [
3444
+ {
3445
+ name: 'value',
3446
+ description:
3447
+ 'Value to validate; trim it first, as a leading or trailing space fails',
3448
+ type: 'string',
3449
+ },
3450
+ ],
3018
3451
  returnType: 'boolean',
3019
3452
  returnDescription:
3020
3453
  'True when the value is a syntactically valid email address, otherwise false.',
@@ -3025,38 +3458,65 @@ export const FUNCTIONS = [
3025
3458
  {
3026
3459
  name: 'IsNull',
3027
3460
  mcnSince: 67,
3028
- handlebarsEquivalent: null,
3461
+ handlebarsEquivalent: 'isEmpty',
3462
+ handlebarsExact: false,
3029
3463
  mcnNotes: null,
3030
3464
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-utilities/mc-ampscript-reference-utilities-is-null.html',
3031
3465
  guideUrl: 'https://ampscript.guide/isnull/',
3466
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/isnull/',
3032
3467
  minArgs: 1,
3033
3468
  maxArgs: 1,
3034
3469
  category: 'Utility',
3035
- description: 'Returns true if the value is null.',
3036
- params: [{ name: 'value', description: 'Value to test' }],
3470
+ description:
3471
+ 'Returns true only for a genuine null, which in practice means a data extension field with no value. An unset or undeclared variable, an empty string, whitespace and every ordinary value all return false, so this is not a general emptiness test.',
3472
+ params: [
3473
+ {
3474
+ name: 'value',
3475
+ description:
3476
+ 'Value to test; typically a data extension field value retrieved with Lookup',
3477
+ type: 'string|number|boolean|date',
3478
+ },
3479
+ ],
3037
3480
  returnType: 'boolean',
3038
- returnDescription: 'True when the value is null, otherwise false.',
3039
- returnEnum: [true, false],
3481
+ returnDescription:
3482
+ 'True when the value is null, otherwise false. Prefer Empty when the intent is to detect a missing or blank value.',
3483
+ isConfirmed: true,
3484
+ differsFromOfficialDocs: true,
3485
+ officialDocsNote:
3486
+ 'The official reference shows a variable declared with VAR and never assigned, and states IsNull returns true for it. On a live Engagement CloudPage on the child business unit (MID 518005426) that exact shape returned False, in a gate that printed its own start and done markers at HTTP 200 alongside a known-good control block. The same False came back for an undeclared variable, an empty string, whitespace, 0, "0", "false", a real value, a date, an absent attribute, an absent request parameter and the subscriber-context tokens. Use Empty for a missing-value test.',
3040
3487
  syntax: 'IsNull(value)',
3041
3488
  example: '%%=IsNull(@value)=%%',
3042
3489
  },
3043
3490
  {
3044
3491
  name: 'IsNullDefault',
3045
3492
  mcnSince: null,
3046
- handlebarsEquivalent: null,
3493
+ handlebarsEquivalent: 'fallback',
3494
+ handlebarsExact: false,
3047
3495
  mcnNotes: null,
3048
3496
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-sites/mc-ampscript-reference-sites-is-null-default.html',
3049
3497
  guideUrl: 'https://ampscript.guide/isnulldefault/',
3498
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/isnulldefault/',
3050
3499
  minArgs: 2,
3051
3500
  maxArgs: 2,
3052
3501
  category: 'Utility',
3053
- description: 'Returns the value if not null, otherwise returns the default.',
3502
+ description:
3503
+ 'Returns the value if not null, otherwise returns the default. Outside a Smart Capture form the default is never reached: on a CloudPage every empty-ish input returns the empty string instead, so it cannot be used as a general fallback.',
3054
3504
  params: [
3055
- { name: 'value', description: 'Value to test' },
3056
- { name: 'defaultValue', description: 'Default to return when null' },
3505
+ {
3506
+ name: 'value',
3507
+ description: 'Value to test; returned unchanged whenever it is present',
3508
+ type: 'string|number|boolean|date',
3509
+ },
3510
+ {
3511
+ name: 'defaultValue',
3512
+ description:
3513
+ 'Default to return when the value is null; only reached in a Smart Capture form context',
3514
+ type: 'string|number|boolean|date',
3515
+ },
3057
3516
  ],
3058
3517
  returnType: 'string',
3059
3518
  returnDescription: 'The original value, or the default value when the original is null.',
3519
+ isConfirmed: true,
3060
3520
  syntax: 'IsNullDefault(value, defaultValue)',
3061
3521
  example: "%%=IsNullDefault(@name, 'Friend')=%%",
3062
3522
  },
@@ -3067,31 +3527,53 @@ export const FUNCTIONS = [
3067
3527
  mcnNotes: null,
3068
3528
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-utilities/mc-ampscript-reference-utilities-is-phone-number.html',
3069
3529
  guideUrl: 'https://ampscript.guide/isphonenumber/',
3530
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/isphonenumber/',
3070
3531
  minArgs: 1,
3071
3532
  maxArgs: 1,
3533
+ isConfirmed: true,
3534
+ differsFromOfficialDocs: false,
3072
3535
  category: 'Utility',
3073
- description: 'Returns true if the value is a valid phone number.',
3074
- params: [{ name: 'value', description: 'Value to validate', type: 'string' }],
3536
+ description:
3537
+ 'Checks a value against the North American Numbering Plan. Dashes, dots, spaces and parentheses are tolerated, but a leading plus sign, any letter, a number outside the plan and a leading country-code digit all fail.',
3538
+ params: [
3539
+ {
3540
+ name: 'value',
3541
+ description:
3542
+ 'Phone number to validate; strip any leading plus sign or country code first',
3543
+ type: 'string|number',
3544
+ },
3545
+ ],
3075
3546
  returnType: 'boolean',
3076
3547
  returnDescription: 'True when the value is a valid phone number, otherwise false.',
3077
3548
  returnEnum: [true, false],
3078
3549
  syntax: 'IsPhoneNumber(value)',
3079
- example: "%%=IsPhoneNumber('+1 718 209 7651')=%%",
3550
+ example: "%%=IsPhoneNumber('425-555-0142')=%%",
3080
3551
  },
3081
3552
  {
3082
3553
  name: 'Length',
3083
3554
  mcnSince: 67,
3084
3555
  handlebarsEquivalent: 'length',
3556
+ handlebarsExact: true,
3085
3557
  mcnNotes: null,
3086
3558
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-string/mc-ampscript-reference-string-length.html',
3087
3559
  guideUrl: 'https://ampscript.guide/length/',
3560
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/length/',
3088
3561
  minArgs: 1,
3089
3562
  maxArgs: 1,
3563
+ isConfirmed: true,
3564
+ differsFromOfficialDocs: false,
3090
3565
  category: 'String',
3091
3566
  description: 'Returns the number of characters in a string.',
3092
- params: [{ name: 'sourceString', description: 'String to measure', type: 'string' }],
3567
+ params: [
3568
+ {
3569
+ name: 'sourceString',
3570
+ description: 'String to measure',
3571
+ type: 'string|number|date',
3572
+ },
3573
+ ],
3093
3574
  returnType: 'number',
3094
- returnDescription: 'The number of characters in the string.',
3575
+ returnDescription:
3576
+ 'The number of UTF-16 code units in the string, so characters outside the Basic Multilingual Plane (such as emoji) count as 2.',
3095
3577
  syntax: 'Length(sourceString)',
3096
3578
  example: "%%=Length('Hello')=%%",
3097
3579
  },
@@ -3128,25 +3610,32 @@ export const FUNCTIONS = [
3128
3610
  {
3129
3611
  name: 'LocalDateToSystemDate',
3130
3612
  mcnSince: null,
3131
- handlebarsEquivalent: null,
3613
+ handlebarsEquivalent: 'timeZoneConversion',
3614
+ handlebarsExact: false,
3132
3615
  mcnNotes: null,
3133
3616
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-date-time/mc-ampscript-reference-date-time-local-date-to-system-date.html',
3134
3617
  guideUrl: 'https://ampscript.guide/localdatetosystemdate/',
3135
3618
  minArgs: 1,
3136
3619
  maxArgs: 1,
3137
3620
  category: 'Date and Time',
3138
- description: 'Converts a local date to the Marketing Cloud system date (Central Time).',
3621
+ description:
3622
+ 'Converts a date in the time zone configured on the account to the Marketing Cloud system date (Central Time, no daylight saving). The shift is not constant: the local side observes daylight saving, so a summer instant moves one hour further than a winter one. A value the date parser cannot read aborts the page instead of returning a sentinel.',
3139
3623
  params: [
3140
3624
  {
3141
3625
  name: 'timeToConvert',
3142
- description: 'The time string that you want to convert',
3143
- type: 'string',
3626
+ description:
3627
+ 'The local time value to convert, as a date value or a parseable date string',
3628
+ type: 'string|date',
3144
3629
  },
3145
3630
  ],
3146
- returnType: 'string',
3147
- returnDescription: 'The supplied local time converted to system (account) time.',
3631
+ returnType: 'date',
3632
+ returnDescription:
3633
+ 'A real date value the other date functions accept directly. Rendered on its own it prints as a US short date followed by a 12-hour clock with an AM/PM suffix.',
3148
3634
  syntax: 'LocalDateToSystemDate(timeToConvert)',
3149
3635
  example: '%%=LocalDateToSystemDate(Now())=%%',
3636
+ isConfirmed: true,
3637
+ differsFromOfficialDocs: false,
3638
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/localdatetosystemdate/',
3150
3639
  },
3151
3640
  {
3152
3641
  name: 'LongSFID',
@@ -3169,7 +3658,8 @@ export const FUNCTIONS = [
3169
3658
  {
3170
3659
  name: 'Lookup',
3171
3660
  mcnSince: 67,
3172
- handlebarsEquivalent: null,
3661
+ handlebarsEquivalent: 'queryFirst',
3662
+ handlebarsExact: false,
3173
3663
  mcnNotes:
3174
3664
  'In MCN, search arguments must be provided in column/value pairs - an odd count causes an error. All filter keys must fully specify the composite primary key.',
3175
3665
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-data-extension/mc-ampscript-reference-data-extension-lookup.html',
@@ -3216,7 +3706,8 @@ export const FUNCTIONS = [
3216
3706
  {
3217
3707
  name: 'LookupOrderedRows',
3218
3708
  mcnSince: null,
3219
- handlebarsEquivalent: null,
3709
+ handlebarsEquivalent: 'query',
3710
+ handlebarsExact: false,
3220
3711
  mcnNotes: null,
3221
3712
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-data-extension/mc-ampscript-reference-data-extension-lookup-ordered-rows.html',
3222
3713
  guideUrl: 'https://ampscript.guide/lookuporderedrows/',
@@ -3270,7 +3761,8 @@ export const FUNCTIONS = [
3270
3761
  {
3271
3762
  name: 'LookupOrderedRowsCS',
3272
3763
  mcnSince: null,
3273
- handlebarsEquivalent: null,
3764
+ handlebarsEquivalent: 'query',
3765
+ handlebarsExact: false,
3274
3766
  mcnNotes: null,
3275
3767
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-data-extension/mc-ampscript-reference-data-extension-lookup-ordered-rows-cs.html',
3276
3768
  guideUrl: 'https://ampscript.guide/lookuporderedrowscs/',
@@ -3323,7 +3815,8 @@ export const FUNCTIONS = [
3323
3815
  {
3324
3816
  name: 'LookupRows',
3325
3817
  mcnSince: null,
3326
- handlebarsEquivalent: null,
3818
+ handlebarsEquivalent: 'query',
3819
+ handlebarsExact: false,
3327
3820
  mcnNotes: null,
3328
3821
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-data-extension/mc-ampscript-reference-data-extension-lookup-rows.html',
3329
3822
  guideUrl: 'https://ampscript.guide/lookuprows/',
@@ -3362,7 +3855,8 @@ export const FUNCTIONS = [
3362
3855
  {
3363
3856
  name: 'LookupRowsCS',
3364
3857
  mcnSince: null,
3365
- handlebarsEquivalent: null,
3858
+ handlebarsEquivalent: 'query',
3859
+ handlebarsExact: false,
3366
3860
  mcnNotes: null,
3367
3861
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-data-extension/mc-ampscript-reference-data-extension-lookup-rows-cs.html',
3368
3862
  guideUrl: 'https://ampscript.guide/lookuprowscs/',
@@ -3402,14 +3896,24 @@ export const FUNCTIONS = [
3402
3896
  name: 'Lowercase',
3403
3897
  mcnSince: 67,
3404
3898
  handlebarsEquivalent: 'lowercase',
3899
+ handlebarsExact: true,
3405
3900
  mcnNotes: null,
3406
3901
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-string/mc-ampscript-reference-string-lowercase.html',
3407
3902
  guideUrl: 'https://ampscript.guide/lowercase/',
3903
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/lowercase/',
3408
3904
  minArgs: 1,
3409
3905
  maxArgs: 1,
3906
+ isConfirmed: true,
3907
+ differsFromOfficialDocs: false,
3410
3908
  category: 'String',
3411
3909
  description: 'Converts a string to all lowercase characters.',
3412
- params: [{ name: 'sourceString', description: 'String to convert', type: 'string' }],
3910
+ params: [
3911
+ {
3912
+ name: 'sourceString',
3913
+ description: 'String to convert',
3914
+ type: 'string|number|date',
3915
+ },
3916
+ ],
3413
3917
  returnType: 'string',
3414
3918
  returnDescription: 'The string converted to lower case.',
3415
3919
  syntax: 'Lowercase(sourceString)',
@@ -3422,27 +3926,37 @@ export const FUNCTIONS = [
3422
3926
  mcnNotes: null,
3423
3927
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-encryption/mc-ampscript-reference-encryption-md5.html',
3424
3928
  guideUrl: 'https://ampscript.guide/md5/',
3929
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/md5/',
3425
3930
  minArgs: 1,
3426
3931
  maxArgs: 2,
3427
3932
  category: 'Encryption and Encoding',
3428
- description: 'Returns the MD5 hash of the input value.',
3933
+ description:
3934
+ 'Returns the MD5 hash of the input value. The bytes hashed are the UTF-8 encoding of the input unless charSet names another encoding, and a number or date argument is hashed as the text it renders as.',
3429
3935
  params: [
3430
- { name: 'stringToConvert', description: 'The string to encode', type: 'string' },
3936
+ {
3937
+ name: 'stringToConvert',
3938
+ description:
3939
+ 'The value to hash; a number or date is hashed as its rendered text, and the empty string yields the well-known empty-input digest',
3940
+ type: 'string|number|date',
3941
+ },
3431
3942
  {
3432
3943
  name: 'charSet',
3433
3944
  mcnSince: null,
3434
3945
  mcnNotes: null,
3435
- description: 'Character set to use for the encoding',
3946
+ description:
3947
+ 'Name of the character encoding applied before hashing; any encoding name the platform recognises works, and an unrecognised or empty name aborts the page',
3436
3948
  type: 'string',
3437
- enum: ['UTF-8', 'UTF-16'],
3949
+ enum: ['UTF-8', 'UTF-16', 'UTF-16BE', 'UTF-32', 'ASCII', 'ISO-8859-1'],
3438
3950
  optional: true,
3439
3951
  default: 'UTF-8',
3440
3952
  },
3441
3953
  ],
3442
3954
  returnType: 'string',
3443
- returnDescription: 'The MD5 hash of the input as a hexadecimal string.',
3955
+ returnDescription: 'The MD5 hash of the input as 32 lowercase hexadecimal characters.',
3444
3956
  syntax: 'MD5(stringToConvert[, charSet])',
3445
3957
  example: '%%=MD5("This is a string of text.")=%%',
3958
+ isConfirmed: true,
3959
+ differsFromOfficialDocs: false,
3446
3960
  },
3447
3961
  {
3448
3962
  name: 'MMS_Content_URL',
@@ -3479,9 +3993,13 @@ export const FUNCTIONS = [
3479
3993
  minArgs: 1,
3480
3994
  maxArgs: INF,
3481
3995
  category: 'Utility',
3482
- description: 'Generates a tracked URL to a microsite page, optionally passing parameters.',
3996
+ description:
3997
+ 'Builds a Classic Content microsite URL whose single encrypted query string carries the page reference and any extra name-value pairs. Every call produces a fresh token, so two calls with identical arguments never match.',
3998
+ isConfirmed: true,
3999
+ differsFromOfficialDocs: false,
4000
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/micrositeurl/',
3483
4001
  params: [
3484
- { name: 'pageId', description: 'Microsite page ID', type: 'number' },
4002
+ { name: 'pageId', description: 'Microsite page ID', type: 'string|number' },
3485
4003
  {
3486
4004
  name: 'paramName1',
3487
4005
  description: 'Query parameter name',
@@ -3508,7 +4026,8 @@ export const FUNCTIONS = [
3508
4026
  },
3509
4027
  ],
3510
4028
  returnType: 'string',
3511
- returnDescription: 'A tracked URL to the referenced microsite page.',
4029
+ returnDescription:
4030
+ 'A microsite page URL carrying one encrypted token; extra name-value pairs are folded into that token rather than appended as readable query parameters.',
3512
4031
  repeat: [{ startIndex: 1, groupSize: 2, minGroups: 0 }],
3513
4032
  syntax: 'MicrositeURL(pageId[, paramName1, paramValue1, paramNameN, paramValueN, ...])',
3514
4033
  example: '%%=MicrositeURL(12345)=%%',
@@ -3517,22 +4036,27 @@ export const FUNCTIONS = [
3517
4036
  name: 'Mod',
3518
4037
  mcnSince: 67,
3519
4038
  handlebarsEquivalent: 'modulo',
4039
+ handlebarsExact: true,
3520
4040
  mcnNotes: null,
3521
4041
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-math/mc-ampscript-reference-math-mod.html',
3522
4042
  guideUrl: 'https://ampscript.guide/mod/',
4043
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/mod/',
3523
4044
  minArgs: 2,
3524
4045
  maxArgs: 2,
3525
4046
  category: 'Math',
3526
4047
  description:
3527
4048
  'Returns the remainder after dividing the first number by the second (modulo).',
3528
4049
  params: [
3529
- { name: 'dividend', description: 'Number to divide', type: 'number' },
3530
- { name: 'divisor', description: 'Number to divide by', type: 'number' },
4050
+ { name: 'dividend', description: 'Number to divide', type: 'string|number' },
4051
+ { name: 'divisor', description: 'Number to divide by', type: 'string|number' },
3531
4052
  ],
3532
4053
  returnType: 'number',
3533
- returnDescription: 'The remainder after dividing the first number by the second.',
4054
+ returnDescription:
4055
+ 'The remainder after dividing the first number by the second. The result takes the sign of the dividend, and a divisor of 0 yields NaN instead of raising an error.',
3534
4056
  syntax: 'Mod(dividend, divisor)',
3535
4057
  example: '%%=Mod(10, 3)=%%',
4058
+ isConfirmed: true,
4059
+ differsFromOfficialDocs: false,
3536
4060
  },
3537
4061
  {
3538
4062
  name: 'Msg',
@@ -3562,21 +4086,25 @@ export const FUNCTIONS = [
3562
4086
  name: 'Multiply',
3563
4087
  mcnSince: 67,
3564
4088
  handlebarsEquivalent: 'multiply',
4089
+ handlebarsExact: true,
3565
4090
  mcnNotes: null,
3566
4091
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-math/mc-ampscript-reference-math-multiply.html',
3567
4092
  guideUrl: 'https://ampscript.guide/multiply/',
4093
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/multiply/',
3568
4094
  minArgs: 2,
3569
4095
  maxArgs: 2,
3570
4096
  category: 'Math',
3571
4097
  description: 'Computes the product of two numeric values.',
3572
4098
  params: [
3573
- { name: 'number1', description: 'First operand', type: 'number' },
3574
- { name: 'number2', description: 'Second operand', type: 'number' },
4099
+ { name: 'number1', description: 'First operand', type: 'string|number' },
4100
+ { name: 'number2', description: 'Second operand', type: 'string|number' },
3575
4101
  ],
3576
4102
  returnType: 'number',
3577
4103
  returnDescription: 'The product of the two operands.',
3578
4104
  syntax: 'Multiply(number1, number2)',
3579
4105
  example: '%%=Multiply(5, 3)=%%',
4106
+ isConfirmed: true,
4107
+ differsFromOfficialDocs: false,
3580
4108
  },
3581
4109
  {
3582
4110
  name: 'Noun',
@@ -3625,26 +4153,32 @@ export const FUNCTIONS = [
3625
4153
  name: 'Now',
3626
4154
  mcnSince: 67,
3627
4155
  handlebarsEquivalent: 'now',
4156
+ handlebarsExact: false,
3628
4157
  mcnNotes: null,
3629
4158
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-date-time/mc-ampscript-reference-date-time-now.html',
3630
4159
  guideUrl: 'https://ampscript.guide/now/',
4160
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/now/',
3631
4161
  minArgs: 0,
3632
4162
  maxArgs: 1,
3633
4163
  category: 'Date and Time',
3634
4164
  description:
3635
- 'Returns the current system date and time (Central Time). Pass 1 to persist the value across renders.',
4165
+ 'Returns the current system date and time in Central Standard Time, with no daylight-saving adjustment. Every call within one render returns the same instant.',
4166
+ isConfirmed: true,
4167
+ differsFromOfficialDocs: false,
3636
4168
  params: [
3637
4169
  {
3638
4170
  name: 'persistFormat',
3639
4171
  mcnSince: null,
3640
4172
  mcnNotes: null,
3641
- description: 'Pass 1 to persist value',
3642
- type: 'boolean',
4173
+ description:
4174
+ 'In a send context, a true value returns the send job start or publish time instead of the current time; on a CloudPage it makes no difference. Accepts 1/0, true/false, or those spellings quoted',
4175
+ type: 'string|boolean|number',
3643
4176
  optional: true,
3644
4177
  },
3645
4178
  ],
3646
4179
  returnType: 'date',
3647
- returnDescription: 'The current date and time.',
4180
+ returnDescription:
4181
+ 'The system date and time, as a date value that the other date functions accept directly.',
3648
4182
  syntax: 'Now([persistFormat])',
3649
4183
  example: '%%=Now()=%%',
3650
4184
  },
@@ -3655,16 +4189,28 @@ export const FUNCTIONS = [
3655
4189
  mcnNotes: null,
3656
4190
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-utilities/mc-ampscript-reference-utilities-output.html',
3657
4191
  guideUrl: 'https://ampscript.guide/output/',
3658
- minArgs: 1,
3659
- maxArgs: 1,
4192
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/output/',
4193
+ minArgs: 0,
4194
+ maxArgs: Infinity,
3660
4195
  category: 'Utility',
3661
4196
  description:
3662
- 'Writes a value to the rendered output. Used inside script blocks to emit content.',
3663
- params: [{ name: 'content', description: 'Content to output' }],
4197
+ 'Writes the result of a nested function call into the rendered content. A string literal, a bare variable or a number renders nothing at all, without raising an error.',
4198
+ params: [
4199
+ {
4200
+ name: 'content',
4201
+ description:
4202
+ 'Function call whose result is written; a literal or bare variable renders nothing',
4203
+ },
4204
+ ],
3664
4205
  returnType: 'void',
3665
- returnDescription: 'No value is returned; the content is written to the message.',
4206
+ returnDescription:
4207
+ 'No value is returned, so the call cannot be nested inside another function; the result is written straight into the rendered content.',
3666
4208
  syntax: 'Output(content)',
3667
4209
  example: "%%=Output(Concat('Hello ', @firstName))=%%",
4210
+ isConfirmed: true,
4211
+ differsFromOfficialDocs: true,
4212
+ officialDocsNote:
4213
+ 'The official reference states that a value which is not a function call, such as a string literal, makes the function return an error. On a live Engagement CloudPage on the child business unit (MID 518005426) a literal argument, a bare variable and a bare number each rendered nothing at all while the page still returned HTTP 200 and every surrounding marker printed, so no error surfaced anywhere. The same page also accepted zero arguments and up to three arguments, writing each one in turn.',
3668
4214
  },
3669
4215
  {
3670
4216
  name: 'OutputLine',
@@ -3673,31 +4219,49 @@ export const FUNCTIONS = [
3673
4219
  mcnNotes: null,
3674
4220
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-utilities/mc-ampscript-reference-utilities-output-line.html',
3675
4221
  guideUrl: 'https://ampscript.guide/outputline/',
3676
- minArgs: 1,
3677
- maxArgs: 1,
4222
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/outputline/',
4223
+ minArgs: 0,
4224
+ maxArgs: Infinity,
3678
4225
  category: 'Utility',
3679
- description: 'Writes a value followed by a line break to the rendered output.',
3680
- params: [{ name: 'content', description: 'Content to output' }],
4226
+ description:
4227
+ 'Writes the result of a nested function call into the rendered content, followed by a carriage return and line feed. A string literal, a bare variable or a number renders only the line break. The break is not an HTML line break, so an HTML view keeps everything on one line unless the content sits inside a preformatted element.',
4228
+ params: [
4229
+ {
4230
+ name: 'content',
4231
+ description:
4232
+ 'Function call whose result is written; a literal or bare variable renders only the line break',
4233
+ },
4234
+ ],
3681
4235
  returnType: 'void',
3682
- returnDescription: 'No value is returned; the content is written followed by a line break.',
4236
+ returnDescription:
4237
+ 'No value is returned, so the call cannot be nested inside another function; the result and a carriage return plus line feed are written straight into the rendered content.',
3683
4238
  syntax: 'OutputLine(content)',
3684
4239
  example: "%%=OutputLine(Concat('Hello ', @firstName))=%%",
4240
+ isConfirmed: true,
4241
+ differsFromOfficialDocs: false,
3685
4242
  },
3686
4243
  {
3687
4244
  name: 'ProperCase',
3688
4245
  mcnSince: 67,
3689
4246
  handlebarsEquivalent: 'properCase',
4247
+ handlebarsExact: true,
3690
4248
  mcnNotes: null,
3691
4249
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-string/mc-ampscript-reference-string-propercase.html',
3692
4250
  guideUrl: 'https://ampscript.guide/propercase/',
4251
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/propercase/',
3693
4252
  minArgs: 1,
3694
4253
  maxArgs: 1,
4254
+ isConfirmed: true,
4255
+ differsFromOfficialDocs: false,
3695
4256
  category: 'String',
3696
4257
  description:
3697
- 'Converts a string to proper (title) case, capitalizing the first letter of each word.',
3698
- params: [{ name: 'sourceString', description: 'String to convert', type: 'string' }],
4258
+ 'Converts a value to proper (title) case. Every letter after the first of a word is forced to lower case, so existing internal capitals are lost.',
4259
+ params: [
4260
+ { name: 'sourceString', description: 'Value to convert', type: 'string|number|date' },
4261
+ ],
3699
4262
  returnType: 'string',
3700
- returnDescription: 'The string with the first letter of each word capitalized.',
4263
+ returnDescription:
4264
+ 'The value with the first letter of each word capitalized and the rest lower-cased.',
3701
4265
  syntax: 'ProperCase(sourceString)',
3702
4266
  example: "%%=ProperCase('hello world')=%%",
3703
4267
  },
@@ -3708,29 +4272,40 @@ export const FUNCTIONS = [
3708
4272
  mcnNotes: null,
3709
4273
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-sites/mc-ampscript-reference-sites-query-parameter.html',
3710
4274
  guideUrl: 'https://ampscript.guide/queryparameter/',
4275
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/queryparameter/',
3711
4276
  minArgs: 1,
3712
4277
  maxArgs: 1,
3713
4278
  category: 'Utility',
3714
4279
  description:
3715
- 'Returns the value of a URL query string parameter from the current page request.',
3716
- params: [{ name: 'parameterName', description: 'Query parameter name', type: 'string' }],
4280
+ 'Returns the value of a URL query string parameter from the current page request. The name is matched without regard to case, percent-encoded characters arrive decoded, and a name supplied more than once yields the values joined by a comma.',
4281
+ params: [
4282
+ {
4283
+ name: 'parameterName',
4284
+ description: 'Query parameter name, matched without regard to case',
4285
+ type: 'string',
4286
+ },
4287
+ ],
3717
4288
  returnType: 'string',
3718
- returnDescription: 'The value of the named query-string parameter.',
4289
+ returnDescription:
4290
+ 'The decoded value of the named query-string parameter, or an empty string when the request carries no such parameter. The value is returned exactly as supplied, so escape it before rendering it into markup.',
3719
4291
  syntax: 'QueryParameter(parameterName)',
3720
4292
  example: "%%=QueryParameter('utm_source')=%%",
4293
+ isConfirmed: true,
3721
4294
  },
3722
4295
  {
3723
4296
  name: 'RaiseError',
3724
4297
  mcnSince: 67,
3725
4298
  handlebarsEquivalent: 'raiseError',
4299
+ handlebarsExact: false,
3726
4300
  mcnNotes: null,
3727
4301
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-utilities/mc-ampscript-reference-utilities-raise-error.html',
3728
4302
  guideUrl: 'https://ampscript.guide/raiseerror/',
4303
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/raiseerror/',
3729
4304
  minArgs: 1,
3730
4305
  maxArgs: 5,
3731
4306
  category: 'Utility',
3732
4307
  description:
3733
- 'Raises a runtime error, optionally skipping the current subscriber or returning an API error.',
4308
+ 'Raises a runtime error, optionally skipping the current subscriber or returning an API error. Outside a send it is not a graceful abort: on a landing page it discards everything already written and answers the same generic failure any other aborting call gives, with the message nowhere in the response.',
3734
4309
  params: [
3735
4310
  { name: 'message', description: 'Error message', type: 'string' },
3736
4311
  {
@@ -3739,7 +4314,7 @@ export const FUNCTIONS = [
3739
4314
  mcnNotes: null,
3740
4315
  description:
3741
4316
  'If true, the function skips only the subscriber for which the error was raised, and proceeds with the rest of the email job. If false, the function stops the entire email job when an error is raised. The default value is false.',
3742
- type: 'boolean',
4317
+ type: 'string|boolean|number',
3743
4318
  optional: true,
3744
4319
  },
3745
4320
  {
@@ -3769,29 +4344,39 @@ export const FUNCTIONS = [
3769
4344
  },
3770
4345
  ],
3771
4346
  returnType: 'void',
3772
- returnDescription: 'No value is returned; message processing is halted with an error.',
4347
+ returnDescription:
4348
+ 'No value is returned; processing is halted. On a landing page the whole request is abandoned and the response body is a fixed failure notice rather than the supplied message.',
3773
4349
  syntax: 'RaiseError(message[, skipSubscriber, apiErrorCode, apiErrorNumber, preserveDataExt])',
3774
4350
  example: "RaiseError('Missing required field', 0)",
4351
+ isConfirmed: true,
4352
+ differsFromOfficialDocs: false,
3775
4353
  },
3776
4354
  {
3777
4355
  name: 'Random',
3778
4356
  mcnSince: 67,
3779
4357
  handlebarsEquivalent: 'random',
4358
+ handlebarsExact: true,
3780
4359
  mcnNotes: null,
3781
4360
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-utilities/mc-ampscript-reference-utilities-random.html',
3782
4361
  guideUrl: 'https://ampscript.guide/random/',
4362
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/random/',
3783
4363
  minArgs: 2,
3784
4364
  maxArgs: 2,
3785
4365
  category: 'Math',
3786
- description: 'Returns a random integer between the two specified values (inclusive).',
4366
+ description:
4367
+ 'Returns a random integer between the two specified values (inclusive). Both bounds must be whole numbers; a decimal bound aborts the page. The bounds may be supplied in either order.',
3787
4368
  params: [
3788
- { name: 'min', description: 'Lower bound (inclusive)', type: 'number' },
3789
- { name: 'max', description: 'Upper bound (inclusive)', type: 'number' },
4369
+ { name: 'min', description: 'Lower bound (inclusive)', type: 'string|number' },
4370
+ { name: 'max', description: 'Upper bound (inclusive)', type: 'string|number' },
3790
4371
  ],
3791
4372
  returnType: 'number',
3792
4373
  returnDescription: 'A random whole number within the supplied range.',
3793
4374
  syntax: 'Random(min, max)',
3794
4375
  example: '%%=Random(1, 100)=%%',
4376
+ isConfirmed: true,
4377
+ differsFromOfficialDocs: true,
4378
+ officialDocsNote:
4379
+ 'The official reference states the bounds may be decimal numbers. On the child QA BU (MID 518005426) every decimal bound aborted the CloudPage with HTTP 422 — Random(1.2,1.8), Random(1,2.5), Random(1.0,3.0) and the quoted form Random("1.5","3.5") all failed, while the equivalent whole-number and numeric-string calls returned values normally. The same decimal calls also aborted on the parent BU (MID 7281698), so this is not a child-BU limitation. Only whole-number bounds are usable at runtime.',
3795
4380
  },
3796
4381
  {
3797
4382
  name: 'RatingStars',
@@ -3820,15 +4405,20 @@ export const FUNCTIONS = [
3820
4405
  mcnNotes: null,
3821
4406
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-sites/mc-ampscript-reference-sites-redirect.html',
3822
4407
  guideUrl: 'https://ampscript.guide/redirect/',
4408
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/redirect/',
3823
4409
  minArgs: 1,
3824
4410
  maxArgs: 1,
3825
4411
  category: 'Utility',
3826
- description: 'Performs an HTTP redirect to the specified URL. Landing pages only.',
3827
- params: [{ name: 'url', description: 'Target URL', type: 'string' }],
4412
+ description:
4413
+ 'Performs an HTTP redirect to the specified URL. Landing pages only. The response is a 302 whose Location is the supplied value verbatim, and everything written before the call is discarded along with the page body. Not to be confused with RedirectTo, which emits no redirect at all.',
4414
+ params: [{ name: 'url', description: 'Target URL', type: 'string|number' }],
3828
4415
  returnType: 'void',
3829
- returnDescription: 'No value is returned; the request is redirected to the supplied URL.',
4416
+ returnDescription:
4417
+ 'No value is returned; the request answers 302 and the supplied value becomes the Location header unchanged, even when it is not an absolute URL.',
3830
4418
  syntax: 'Redirect(url)',
3831
4419
  example: "Redirect('https://example.com')",
4420
+ isConfirmed: true,
4421
+ differsFromOfficialDocs: false,
3832
4422
  },
3833
4423
  {
3834
4424
  name: 'RedirectTo',
@@ -3840,10 +4430,15 @@ export const FUNCTIONS = [
3840
4430
  minArgs: 1,
3841
4431
  maxArgs: 1,
3842
4432
  category: 'Utility',
3843
- description: 'Creates a trackable redirect URL, typically used in email links.',
3844
- params: [{ name: 'url', description: 'Target URL', type: 'string' }],
4433
+ description:
4434
+ 'Marks a URL held in a variable or field as a tracked email link. It never redirects the current request and never halts the script; outside a tracked send it hands the value straight back.',
4435
+ isConfirmed: true,
4436
+ differsFromOfficialDocs: false,
4437
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/redirectto/',
4438
+ params: [{ name: 'url', description: 'Target URL', type: 'string|number' }],
3845
4439
  returnType: 'string',
3846
- returnDescription: 'A tracked URL that redirects to the supplied address.',
4440
+ returnDescription:
4441
+ 'The link-tracking target for the supplied address during a tracked send; on a CloudPage the supplied value unchanged.',
3847
4442
  syntax: 'RedirectTo(url)',
3848
4443
  example: '%%=RedirectTo(@targetUrl)=%%',
3849
4444
  },
@@ -3854,13 +4449,20 @@ export const FUNCTIONS = [
3854
4449
  mcnNotes: null,
3855
4450
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-string/mc-ampscript-reference-string-regex-match.html',
3856
4451
  guideUrl: 'https://ampscript.guide/regexmatch/',
4452
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/regexmatch/',
4453
+ isConfirmed: true,
4454
+ differsFromOfficialDocs: false,
3857
4455
  minArgs: 3,
3858
- maxArgs: 4,
4456
+ maxArgs: Infinity,
3859
4457
  category: 'String',
3860
4458
  description:
3861
- 'Tests a string against a regular expression pattern and returns first occurrence of the matching regular expression pattern.',
4459
+ 'Returns the first occurrence of a regular expression match in a string, selected by capture group. Matching is case-sensitive unless the IgnoreCase option is passed.',
3862
4460
  params: [
3863
- { name: 'sourceString', description: 'String to match against', type: 'string' },
4461
+ {
4462
+ name: 'sourceString',
4463
+ description: 'String to match against',
4464
+ type: 'string|number',
4465
+ },
3864
4466
  {
3865
4467
  name: 'regExPattern',
3866
4468
  description: 'The regular expression to use in the search',
@@ -3868,20 +4470,28 @@ export const FUNCTIONS = [
3868
4470
  },
3869
4471
  {
3870
4472
  name: 'returnValue',
3871
- description: 'The name or ordinal of the matching group to return',
3872
- type: 'string',
4473
+ description:
4474
+ 'Index or name of the capture group to return; 0 returns the whole match',
4475
+ type: 'string|number',
3873
4476
  },
3874
4477
  {
3875
4478
  name: 'regExOptions',
3876
4479
  description:
3877
- 'A .NET RegexOptions value to apply to the search, such as IgnoreCase or Multiline',
4480
+ 'A .NET RegexOptions member name to apply to the search, such as IgnoreCase or Multiline',
4481
+ type: 'string',
4482
+ optional: true,
4483
+ },
4484
+ {
4485
+ name: 'regExOptionsN',
4486
+ description: 'Additional RegexOptions member name',
3878
4487
  type: 'string',
3879
4488
  optional: true,
3880
4489
  },
3881
4490
  ],
3882
4491
  returnType: 'string',
3883
- returnDescription: 'The matched text, or an empty string when there is no match.',
3884
- syntax: 'RegExMatch(sourceString, regExPattern, returnValue[, regExOptions])',
4492
+ returnDescription:
4493
+ 'The text of the selected capture group, or an empty string when the pattern does not match or the group does not exist.',
4494
+ syntax: 'RegExMatch(sourceString, regExPattern, returnValue[, regExOptions, ...])',
3885
4495
  example:
3886
4496
  'Var @couponCode, @regEx, @regExMatch\n' +
3887
4497
  'Set @couponCode = "SAVE23"\n' +
@@ -3892,21 +4502,32 @@ export const FUNCTIONS = [
3892
4502
  name: 'Replace',
3893
4503
  mcnSince: 67,
3894
4504
  handlebarsEquivalent: 'replace',
4505
+ handlebarsExact: false,
3895
4506
  mcnNotes: null,
3896
4507
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-string/mc-ampscript-reference-string-replace.html',
3897
4508
  guideUrl: 'https://ampscript.guide/replace/',
3898
- minArgs: 3,
4509
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/replace/',
4510
+ isConfirmed: true,
4511
+ differsFromOfficialDocs: false,
4512
+ minArgs: 2,
3899
4513
  maxArgs: 3,
3900
4514
  category: 'String',
3901
- description: 'Replaces all occurrences of a substring with a new value.',
4515
+ description:
4516
+ 'Replaces all occurrences of a substring with a new value, matching case-insensitively. The source is scanned once, so text formed by a replacement is not replaced again.',
3902
4517
  params: [
3903
- { name: 'sourceString', description: 'Source string', type: 'string' },
3904
- { name: 'searchSubstring', description: 'Substring to find', type: 'string' },
3905
- { name: 'replacementSubstring', description: 'Replacement string', type: 'string' },
4518
+ { name: 'sourceString', description: 'Source string', type: 'string|number' },
4519
+ { name: 'searchSubstring', description: 'Substring to find', type: 'string|number' },
4520
+ {
4521
+ name: 'replacementSubstring',
4522
+ description: 'Replacement string. If omitted, the search text is removed.',
4523
+ type: 'string|number',
4524
+ optional: true,
4525
+ },
3906
4526
  ],
3907
4527
  returnType: 'string',
3908
- returnDescription: 'The string with all occurrences of the search text replaced.',
3909
- syntax: 'Replace(sourceString, searchSubstring, replacementSubstring)',
4528
+ returnDescription:
4529
+ 'The string with every occurrence of the search text replaced, or the source unchanged when the search text is not found.',
4530
+ syntax: 'Replace(sourceString, searchSubstring[, replacementSubstring])',
3910
4531
  example: "%%=Replace('Hello World', 'World', 'There')=%%",
3911
4532
  },
3912
4533
  {
@@ -3919,24 +4540,28 @@ export const FUNCTIONS = [
3919
4540
  minArgs: 3,
3920
4541
  maxArgs: INF,
3921
4542
  category: 'String',
3922
- description: 'Replaces multiple old values in a string with a single new value.',
4543
+ description:
4544
+ 'Replaces every occurrence of each supplied search value with one common replacement value, matching case-insensitively. The search values are applied one after another in the order given, so text produced by an earlier replacement can still be matched by a later one.',
3923
4545
  params: [
3924
- { name: 'sourceString', description: 'Source string', type: 'string' },
3925
- { name: 'replacementString', description: 'Replacement string', type: 'string' },
3926
- { name: 'searchString1', description: 'First value to replace', type: 'string' },
4546
+ { name: 'sourceString', description: 'Source string', type: 'string|number' },
4547
+ { name: 'replacementString', description: 'Replacement string', type: 'string|number' },
4548
+ { name: 'searchString1', description: 'First value to replace', type: 'string|number' },
3927
4549
  {
3928
4550
  name: 'searchStringN',
3929
4551
  description: 'Additional value to replace',
3930
- type: 'string',
4552
+ type: 'string|number',
3931
4553
  optional: true,
3932
4554
  },
3933
4555
  ],
3934
4556
  returnType: 'string',
3935
4557
  returnDescription:
3936
- 'The string with every supplied search value replaced by the replacement.',
4558
+ 'The string with every supplied search value replaced by the replacement, or the source unchanged when none of them is found.',
3937
4559
  repeat: [{ startIndex: 2, groupSize: 1, minGroups: 1 }],
3938
4560
  syntax: 'ReplaceList(sourceString, replacementString, searchString1[, searchStringN, ...])',
3939
4561
  example: "%%=ReplaceList('a-b/c', '_', '-', '/')=%%",
4562
+ isConfirmed: true,
4563
+ differsFromOfficialDocs: false,
4564
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/replacelist/',
3940
4565
  },
3941
4566
  {
3942
4567
  name: 'RequestParameter',
@@ -3945,16 +4570,25 @@ export const FUNCTIONS = [
3945
4570
  mcnNotes: null,
3946
4571
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-sites/mc-ampscript-reference-sites-request-parameter.html',
3947
4572
  guideUrl: 'https://ampscript.guide/requestparameter/',
4573
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/requestparameter/',
3948
4574
  minArgs: 1,
3949
4575
  maxArgs: 1,
3950
4576
  category: 'Utility',
3951
4577
  description:
3952
- 'Returns the value of a form post or query string parameter from the current request.',
3953
- params: [{ name: 'parameterName', description: 'Parameter name', type: 'string' }],
4578
+ 'Returns the value of a form post or query string parameter from the current request. The name is matched without regard to case, percent-encoded characters arrive decoded, and a name supplied more than once yields the values joined by a comma.',
4579
+ params: [
4580
+ {
4581
+ name: 'parameterName',
4582
+ description: 'Parameter name, matched without regard to case',
4583
+ type: 'string',
4584
+ },
4585
+ ],
3954
4586
  returnType: 'string',
3955
- returnDescription: 'The value of the named request parameter.',
4587
+ returnDescription:
4588
+ 'The decoded value of the named request parameter, or an empty string when the request carries no such parameter. The value is returned exactly as supplied, so escape it before rendering it into markup.',
3956
4589
  syntax: 'RequestParameter(parameterName)',
3957
4590
  example: "%%=RequestParameter('id')=%%",
4591
+ isConfirmed: true,
3958
4592
  },
3959
4593
  {
3960
4594
  name: 'RetrieveMSCRMRecords',
@@ -4036,7 +4670,8 @@ export const FUNCTIONS = [
4036
4670
  {
4037
4671
  name: 'RetrieveSalesforceObjects',
4038
4672
  mcnSince: 67,
4039
- handlebarsEquivalent: null,
4673
+ handlebarsEquivalent: 'query',
4674
+ handlebarsExact: false,
4040
4675
  mcnNotes: null,
4041
4676
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-salesforce/mc-ampscript-reference-salesforce-retrieve-objects.html',
4042
4677
  guideUrl: 'https://ampscript.guide/retrievesalesforceobjects/',
@@ -4096,7 +4731,8 @@ export const FUNCTIONS = [
4096
4731
  {
4097
4732
  name: 'Row',
4098
4733
  mcnSince: 67,
4099
- handlebarsEquivalent: null,
4734
+ handlebarsEquivalent: 'get',
4735
+ handlebarsExact: false,
4100
4736
  mcnNotes: null,
4101
4737
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-data-extension/mc-ampscript-reference-data-extension-row.html',
4102
4738
  guideUrl: 'https://ampscript.guide/row/',
@@ -4116,7 +4752,8 @@ export const FUNCTIONS = [
4116
4752
  {
4117
4753
  name: 'RowCount',
4118
4754
  mcnSince: 67,
4119
- handlebarsEquivalent: null,
4755
+ handlebarsEquivalent: 'length',
4756
+ handlebarsExact: false,
4120
4757
  mcnNotes: null,
4121
4758
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-data-extension/mc-ampscript-reference-data-extension-row-count.html',
4122
4759
  guideUrl: 'https://ampscript.guide/rowcount/',
@@ -4226,27 +4863,37 @@ export const FUNCTIONS = [
4226
4863
  mcnNotes: null,
4227
4864
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-encryption/mc-ampscript-reference-encryption-sha1.html',
4228
4865
  guideUrl: 'https://ampscript.guide/sha1/',
4866
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/sha1/',
4229
4867
  minArgs: 1,
4230
4868
  maxArgs: 2,
4231
4869
  category: 'Encryption and Encoding',
4232
- description: 'Returns the SHA-1 hash of the input value.',
4870
+ description:
4871
+ 'Returns the SHA-1 hash of the input value. The bytes hashed are the UTF-8 encoding of the input unless charSet names another encoding, and a number or date argument is hashed as the text it renders as.',
4233
4872
  params: [
4234
- { name: 'stringToConvert', description: 'The string to encode', type: 'string' },
4873
+ {
4874
+ name: 'stringToConvert',
4875
+ description:
4876
+ 'The value to hash; a number or date is hashed as its rendered text, and the empty string yields the well-known empty-input digest',
4877
+ type: 'string|number|date',
4878
+ },
4235
4879
  {
4236
4880
  name: 'charSet',
4237
4881
  mcnSince: null,
4238
4882
  mcnNotes: null,
4239
- description: 'Character set to use for the encoding',
4883
+ description:
4884
+ 'Name of the character encoding applied before hashing; any encoding name the platform recognises works, and an unrecognised or empty name aborts the page',
4240
4885
  type: 'string',
4241
- enum: ['UTF-8', 'UTF-16'],
4886
+ enum: ['UTF-8', 'UTF-16', 'UTF-16BE', 'UTF-32', 'ASCII', 'ISO-8859-1'],
4242
4887
  optional: true,
4243
4888
  default: 'UTF-8',
4244
4889
  },
4245
4890
  ],
4246
4891
  returnType: 'string',
4247
- returnDescription: 'The SHA-1 hash of the input as a hexadecimal string.',
4892
+ returnDescription: 'The SHA-1 hash of the input as 40 lowercase hexadecimal characters.',
4248
4893
  syntax: 'SHA1(stringToConvert[, charSet])',
4249
4894
  example: "%%=SHA1('This is a string of text.')=%%",
4895
+ isConfirmed: true,
4896
+ differsFromOfficialDocs: false,
4250
4897
  },
4251
4898
  {
4252
4899
  name: 'SHA256',
@@ -4255,27 +4902,37 @@ export const FUNCTIONS = [
4255
4902
  mcnNotes: null,
4256
4903
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-encryption/mc-ampscript-reference-encryption-sha256.html',
4257
4904
  guideUrl: 'https://ampscript.guide/sha256/',
4905
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/sha256/',
4258
4906
  minArgs: 1,
4259
4907
  maxArgs: 2,
4260
4908
  category: 'Encryption and Encoding',
4261
- description: 'Returns the SHA-256 hash of the input value.',
4909
+ description:
4910
+ 'Returns the SHA-256 hash of the input value. The bytes hashed are the UTF-8 encoding of the input unless charSet names another encoding, and a number or date argument is hashed as the text it renders as.',
4262
4911
  params: [
4263
- { name: 'stringToConvert', description: 'The string to encode', type: 'string' },
4912
+ {
4913
+ name: 'stringToConvert',
4914
+ description:
4915
+ 'The value to hash; a number or date is hashed as its rendered text, and the empty string yields the well-known empty-input digest',
4916
+ type: 'string|number|date',
4917
+ },
4264
4918
  {
4265
4919
  name: 'charSet',
4266
4920
  mcnSince: null,
4267
4921
  mcnNotes: null,
4268
- description: 'Character set to use for the encoding',
4922
+ description:
4923
+ 'Name of the character encoding applied before hashing; any encoding name the platform recognises works, and an unrecognised or empty name aborts the page',
4269
4924
  type: 'string',
4270
- enum: ['UTF-8', 'UTF-16'],
4925
+ enum: ['UTF-8', 'UTF-16', 'UTF-16BE', 'UTF-32', 'ASCII', 'ISO-8859-1'],
4271
4926
  optional: true,
4272
4927
  default: 'UTF-8',
4273
4928
  },
4274
4929
  ],
4275
4930
  returnType: 'string',
4276
- returnDescription: 'The SHA-256 hash of the input as a hexadecimal string.',
4931
+ returnDescription: 'The SHA-256 hash of the input as 64 lowercase hexadecimal characters.',
4277
4932
  syntax: 'SHA256(stringToConvert[, charSet])',
4278
4933
  example: '%%=SHA256("This is a string of text.")=%%',
4934
+ isConfirmed: true,
4935
+ differsFromOfficialDocs: false,
4279
4936
  },
4280
4937
  {
4281
4938
  name: 'SHA512',
@@ -4284,27 +4941,37 @@ export const FUNCTIONS = [
4284
4941
  mcnNotes: null,
4285
4942
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-encryption/mc-ampscript-reference-encryption-sha512.html',
4286
4943
  guideUrl: 'https://ampscript.guide/sha512/',
4944
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/sha512/',
4287
4945
  minArgs: 1,
4288
4946
  maxArgs: 2,
4289
4947
  category: 'Encryption and Encoding',
4290
- description: 'Returns the SHA-512 hash of the input value.',
4948
+ description:
4949
+ 'Returns the SHA-512 hash of the input value. The bytes hashed are the UTF-8 encoding of the input unless charSet names another encoding, and a number or date argument is hashed as the text it renders as.',
4291
4950
  params: [
4292
- { name: 'stringToConvert', description: 'The string to encode', type: 'string' },
4951
+ {
4952
+ name: 'stringToConvert',
4953
+ description:
4954
+ 'The value to hash; a number or date is hashed as its rendered text, and the empty string yields the well-known empty-input digest',
4955
+ type: 'string|number|date',
4956
+ },
4293
4957
  {
4294
4958
  name: 'charSet',
4295
4959
  mcnSince: null,
4296
4960
  mcnNotes: null,
4297
- description: 'Character set to use for the encoding',
4961
+ description:
4962
+ 'Name of the character encoding applied before hashing; any encoding name the platform recognises works, and an unrecognised or empty name aborts the page',
4298
4963
  type: 'string',
4299
- enum: ['UTF-8', 'UTF-16'],
4964
+ enum: ['UTF-8', 'UTF-16', 'UTF-16BE', 'UTF-32', 'ASCII', 'ISO-8859-1'],
4300
4965
  optional: true,
4301
4966
  default: 'UTF-8',
4302
4967
  },
4303
4968
  ],
4304
4969
  returnType: 'string',
4305
- returnDescription: 'The SHA-512 hash of the input as a hexadecimal string.',
4970
+ returnDescription: 'The SHA-512 hash of the input as 128 lowercase hexadecimal characters.',
4306
4971
  syntax: 'SHA512(stringToConvert[, charSet])',
4307
4972
  example: "%%=SHA512('This is a string of text.')=%%",
4973
+ isConfirmed: true,
4974
+ differsFromOfficialDocs: false,
4308
4975
  },
4309
4976
  {
4310
4977
  name: 'StringToDate',
@@ -4314,15 +4981,27 @@ export const FUNCTIONS = [
4314
4981
  'In MCN, returns a locale-formatted string (G standard format, e.g. "5/15/2026 1:23:45 PM") instead of a dateTime object. Cannot be reliably passed to FormatDate() or other date functions in MCN - use FormatDate() directly instead.',
4315
4982
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-date-time/mc-ampscript-reference-date-time-string-to-date.html',
4316
4983
  guideUrl: 'https://ampscript.guide/stringtodate/',
4984
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/stringtodate/',
4317
4985
  minArgs: 1,
4318
4986
  maxArgs: 1,
4319
4987
  category: 'Date and Time',
4320
- description: 'Converts a date string to a date value.',
4321
- params: [{ name: 'dateString', description: 'String to convert', type: 'string' }],
4988
+ description:
4989
+ 'Converts a date string to a date value. Behaves identically to DateParse for every input format tested, but takes no second argument, so DateParse is the only one of the two that can return the instant in UTC. A string the parser cannot read aborts the page instead of returning a sentinel, and an ambiguous day-first string such as 5/8/2026 is silently read month-first rather than rejected.',
4990
+ params: [
4991
+ {
4992
+ name: 'dateString',
4993
+ description:
4994
+ 'A date or timestamp string, or an existing date value; anything the parser cannot read aborts the page',
4995
+ type: 'string|date',
4996
+ },
4997
+ ],
4322
4998
  returnType: 'date',
4323
- returnDescription: 'The date value parsed from the supplied string.',
4999
+ returnDescription:
5000
+ 'A real date value the other date functions accept directly. Rendered on its own it prints as a US short date followed by a 12-hour clock with an AM/PM suffix.',
4324
5001
  syntax: 'StringToDate(dateString)',
4325
5002
  example: "%%=StringToDate('2026-01-15')=%%",
5003
+ isConfirmed: true,
5004
+ differsFromOfficialDocs: false,
4326
5005
  },
4327
5006
  {
4328
5007
  name: 'StringToHex',
@@ -4334,54 +5013,70 @@ export const FUNCTIONS = [
4334
5013
  minArgs: 1,
4335
5014
  maxArgs: 2,
4336
5015
  category: 'Encryption and Encoding',
4337
- description: 'Converts a string to its hexadecimal representation.',
5016
+ description:
5017
+ 'Converts a string to its hexadecimal representation. The bytes rendered are the UTF-8 encoding of the input unless charSet names another encoding.',
4338
5018
  params: [
4339
5019
  {
4340
5020
  name: 'sourceString',
4341
- description: 'The string to convert to hexadecimal character codes',
5021
+ description:
5022
+ 'The string to convert to hexadecimal character codes; the empty string yields the empty string',
4342
5023
  type: 'string',
4343
5024
  },
4344
5025
  {
4345
5026
  name: 'charSet',
4346
- description: 'Character set to use for encoding',
5027
+ description:
5028
+ 'Character set to use for encoding; any encoding name the platform recognises works, and an unrecognised or empty name aborts the page',
4347
5029
  type: 'string',
4348
- enum: ['UTF-8', 'UTF-16'],
5030
+ enum: ['UTF-8', 'UTF-16', 'UTF-16BE', 'UTF-32', 'ASCII', 'ISO-8859-1'],
4349
5031
  optional: true,
4350
5032
  default: 'UTF-8',
4351
5033
  },
4352
5034
  ],
4353
5035
  returnType: 'string',
4354
- returnDescription: 'The hexadecimal representation of the input string.',
5036
+ returnDescription:
5037
+ 'The hexadecimal representation of the input string, in lowercase digits with no separators.',
4355
5038
  syntax: 'StringToHex(sourceString[, charSet])',
4356
5039
  example: "%%=StringToHex('AB')=%%",
5040
+ isConfirmed: true,
5041
+ differsFromOfficialDocs: false,
5042
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/stringtohex/',
4357
5043
  },
4358
5044
  {
4359
5045
  name: 'Substring',
4360
5046
  mcnSince: 67,
4361
5047
  handlebarsEquivalent: 'substring',
5048
+ handlebarsExact: true,
4362
5049
  mcnNotes: null,
4363
5050
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-string/mc-ampscript-reference-string-substring.html',
4364
5051
  guideUrl: 'https://ampscript.guide/substring/',
5052
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/substring/',
5053
+ isConfirmed: true,
5054
+ differsFromOfficialDocs: false,
4365
5055
  minArgs: 2,
4366
5056
  maxArgs: 3,
4367
5057
  category: 'String',
4368
5058
  description:
4369
- 'Extracts a portion of a string starting at the given index for the specified length.',
5059
+ 'Extracts a portion of a string starting at the given index for the specified length. A start position below 1 is treated as the first character.',
4370
5060
  params: [
4371
- { name: 'sourceString', description: 'Source string', type: 'string' },
4372
- { name: 'startPosition', description: '1-based start position', type: 'number' },
5061
+ { name: 'sourceString', description: 'Source string', type: 'string|number' },
5062
+ {
5063
+ name: 'startPosition',
5064
+ description: '1-based start position, as a whole number',
5065
+ type: 'string|number',
5066
+ },
4373
5067
  {
4374
5068
  name: 'substringLength',
4375
5069
  mcnSince: 67,
4376
5070
  mcnNotes: null,
4377
5071
  description:
4378
- 'Number of characters to extract. If omitted, returns the remainder of the string.',
4379
- type: 'number',
5072
+ 'Number of characters to extract, as a whole number. If omitted, returns the remainder of the string.',
5073
+ type: 'string|number',
4380
5074
  optional: true,
4381
5075
  },
4382
5076
  ],
4383
5077
  returnType: 'string',
4384
- returnDescription: 'The requested portion of the string.',
5078
+ returnDescription:
5079
+ 'The requested portion of the string, or an empty string when the start position is past the end of the source.',
4385
5080
  syntax: 'Substring(sourceString, startPosition[, substringLength])',
4386
5081
  example: "%%=Substring('Hello World', 1, 5)=%%",
4387
5082
  },
@@ -4389,26 +5084,31 @@ export const FUNCTIONS = [
4389
5084
  name: 'Subtract',
4390
5085
  mcnSince: 67,
4391
5086
  handlebarsEquivalent: 'subtract',
5087
+ handlebarsExact: true,
4392
5088
  mcnNotes: null,
4393
5089
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-math/mc-ampscript-reference-math-subtract.html',
4394
5090
  guideUrl: 'https://ampscript.guide/subtract/',
5091
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/subtract/',
4395
5092
  minArgs: 2,
4396
5093
  maxArgs: 2,
4397
5094
  category: 'Math',
4398
5095
  description: 'Computes the difference between two numeric values.',
4399
5096
  params: [
4400
- { name: 'minuend', description: 'Value to subtract from', type: 'number' },
4401
- { name: 'subtrahend', description: 'Value to subtract', type: 'number' },
5097
+ { name: 'minuend', description: 'Value to subtract from', type: 'string|number' },
5098
+ { name: 'subtrahend', description: 'Value to subtract', type: 'string|number' },
4402
5099
  ],
4403
5100
  returnType: 'number',
4404
5101
  returnDescription: 'The difference of the two operands.',
4405
5102
  syntax: 'Subtract(minuend, subtrahend)',
4406
5103
  example: '%%=Subtract(50, 15)=%%',
5104
+ isConfirmed: true,
5105
+ differsFromOfficialDocs: false,
4407
5106
  },
4408
5107
  {
4409
5108
  name: 'SystemDateToLocalDate',
4410
5109
  mcnSince: null,
4411
- handlebarsEquivalent: null,
5110
+ handlebarsEquivalent: 'timeZoneConversion',
5111
+ handlebarsExact: false,
4412
5112
  mcnNotes: null,
4413
5113
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-date-time/mc-ampscript-reference-date-time-system-date-to-local-date.html',
4414
5114
  guideUrl: 'https://ampscript.guide/systemdatetolocaldate/',
@@ -4416,16 +5116,21 @@ export const FUNCTIONS = [
4416
5116
  maxArgs: 1,
4417
5117
  category: 'Date and Time',
4418
5118
  description:
4419
- "Converts a Marketing Cloud system date (Central Time) to the subscriber's local time.",
5119
+ 'Converts a Marketing Cloud system date (Central Time, no daylight saving) to the time zone configured on the account. The shift is not constant: the local side observes daylight saving, so a summer instant moves one hour further than a winter one. A value the date parser cannot read aborts the page instead of returning a sentinel.',
4420
5120
  params: [
4421
5121
  {
4422
5122
  name: 'systemTime',
4423
- description: 'The system time value that you want to convert to local time',
4424
- type: 'string',
5123
+ description:
5124
+ 'The system time value to convert, as a date value or a parseable date string',
5125
+ type: 'string|date',
4425
5126
  },
4426
5127
  ],
4427
- returnType: 'string',
4428
- returnDescription: 'The supplied system (account) time converted to local time.',
5128
+ returnType: 'date',
5129
+ returnDescription:
5130
+ 'A real date value the other date functions accept directly. Rendered on its own it prints as a US short date followed by a 12-hour clock with an AM/PM suffix.',
5131
+ isConfirmed: true,
5132
+ differsFromOfficialDocs: false,
5133
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/systemdatetolocaldate/',
4429
5134
  syntax: 'SystemDateToLocalDate(systemTime)',
4430
5135
  example: '%%=SystemDateToLocalDate(Now())=%%',
4431
5136
  },
@@ -4508,14 +5213,21 @@ export const FUNCTIONS = [
4508
5213
  name: 'Trim',
4509
5214
  mcnSince: 67,
4510
5215
  handlebarsEquivalent: 'trim',
5216
+ handlebarsExact: true,
4511
5217
  mcnNotes: null,
4512
5218
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-string/mc-ampscript-reference-string-trim.html',
4513
5219
  guideUrl: 'https://ampscript.guide/trim/',
5220
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/trim/',
4514
5221
  minArgs: 1,
4515
5222
  maxArgs: 1,
5223
+ isConfirmed: true,
5224
+ differsFromOfficialDocs: false,
4516
5225
  category: 'String',
4517
- description: 'Removes leading and trailing whitespace from a string.',
4518
- params: [{ name: 'sourceString', description: 'String to trim', type: 'string' }],
5226
+ description:
5227
+ 'Removes leading and trailing whitespace from a value. Tabs, line breaks and the non-breaking space count as whitespace.',
5228
+ params: [
5229
+ { name: 'sourceString', description: 'Value to trim', type: 'string|number|date' },
5230
+ ],
4519
5231
  returnType: 'string',
4520
5232
  returnDescription: 'The string with leading and trailing whitespace removed.',
4521
5233
  syntax: 'Trim(sourceString)',
@@ -4744,14 +5456,25 @@ export const FUNCTIONS = [
4744
5456
  name: 'Uppercase',
4745
5457
  mcnSince: 67,
4746
5458
  handlebarsEquivalent: 'uppercase',
5459
+ handlebarsExact: true,
4747
5460
  mcnNotes: null,
4748
5461
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-string/mc-ampscript-reference-string-uppercase.html',
4749
5462
  guideUrl: 'https://ampscript.guide/uppercase/',
5463
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/uppercase/',
4750
5464
  minArgs: 1,
4751
5465
  maxArgs: 1,
5466
+ isConfirmed: true,
5467
+ differsFromOfficialDocs: false,
4752
5468
  category: 'String',
4753
- description: 'Converts a string to all uppercase characters.',
4754
- params: [{ name: 'sourceString', description: 'String to convert', type: 'string' }],
5469
+ description:
5470
+ 'Converts a string to all uppercase characters. The German sharp s remains unchanged rather than expanding to SS.',
5471
+ params: [
5472
+ {
5473
+ name: 'sourceString',
5474
+ description: 'String to convert',
5475
+ type: 'string|number|date',
5476
+ },
5477
+ ],
4755
5478
  returnType: 'string',
4756
5479
  returnDescription: 'The string converted to upper case.',
4757
5480
  syntax: 'Uppercase(sourceString)',
@@ -5039,28 +5762,32 @@ export const FUNCTIONS = [
5039
5762
  minArgs: 1,
5040
5763
  maxArgs: 3,
5041
5764
  category: 'Encryption and Encoding',
5042
- description: 'URL-encodes a string for safe inclusion in a URL.',
5765
+ description:
5766
+ 'URL-encodes a string for safe inclusion in a URL. By default only the part after a question mark is touched, so a value that is not a URL passes through unchanged unless the third argument is switched on.',
5767
+ isConfirmed: true,
5768
+ differsFromOfficialDocs: false,
5769
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/urlencode/',
5043
5770
  params: [
5044
5771
  {
5045
5772
  name: 'urlToEncode',
5046
5773
  description: 'The string to convert to a format that is safe to include in URLs',
5047
- type: 'string',
5774
+ type: 'string|number',
5048
5775
  },
5049
5776
  {
5050
5777
  name: 'encodeAllChars',
5051
5778
  mcnSince: null,
5052
5779
  mcnNotes: null,
5053
5780
  description:
5054
- 'If true, the function converts all spaces and non-ASCII characters in a URL parameter string to their hexadecimal character codes. If false, the function only converts spaces in a URL parameter string to the hexadecimal character code %20, and leaves other characters unchanged. The default value is false',
5055
- type: 'boolean',
5781
+ 'When switched on, every reserved character of the query string is percent-encoded and spaces become plus signs; when off, only spaces are encoded, as %20. Accepts 1/0, true/false, or those spellings quoted. Defaults to off',
5782
+ type: 'string|boolean|number',
5056
5783
  optional: true,
5057
5784
  default: false,
5058
5785
  },
5059
5786
  {
5060
5787
  name: 'encodeAllStrings',
5061
5788
  description:
5062
- 'If true, the function converts any text string that you pass as the first parameter into a version that is safe to use in URLs. If false, the function only converts a string into a URL-safe version if the unsafe characters are part of a URL parameter string.',
5063
- type: 'boolean',
5789
+ 'When switched on, the whole input is encoded even if it is not a URL; when off, only the part after a question mark is encoded. Accepts 1/0, true/false, or those spellings quoted. Defaults to off',
5790
+ type: 'string|boolean|number',
5064
5791
  optional: true,
5065
5792
  },
5066
5793
  ],
@@ -5094,16 +5821,24 @@ export const FUNCTIONS = [
5094
5821
  mcnNotes: null,
5095
5822
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-utilities/mc-ampscript-reference-utilities-v.html',
5096
5823
  guideUrl: 'https://ampscript.guide/v/',
5824
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/v/',
5097
5825
  minArgs: 1,
5098
5826
  maxArgs: 1,
5099
5827
  category: 'Utility',
5100
5828
  description:
5101
- 'Short alias for retrieving a variable value inline. Equivalent to %%=v(@var)=%%.',
5102
- params: [{ name: 'variableName', description: 'Variable reference' }],
5829
+ 'Outputs a value inline, normally a variable reference. A string or number literal and a nested function call are accepted as well, each rendering its own value.',
5830
+ params: [
5831
+ {
5832
+ name: 'variableName',
5833
+ description: 'Variable reference, literal or nested function call to output',
5834
+ type: 'string|number',
5835
+ },
5836
+ ],
5103
5837
  returnType: 'string',
5104
- returnDescription: 'The value of the referenced variable as a string.',
5838
+ returnDescription: 'The referenced value rendered as a string.',
5105
5839
  syntax: 'v(variableName)',
5106
5840
  example: '%%=v(@myVar)=%%',
5841
+ isConfirmed: true,
5107
5842
  },
5108
5843
  {
5109
5844
  name: 'WAT',
@@ -5141,6 +5876,9 @@ export const FUNCTIONS = [
5141
5876
  repeat: [{ startIndex: 1, groupSize: 1, minGroups: 1 }],
5142
5877
  syntax: 'WAT(parameterSetKey, parameterValue1[, parameterValueN, ...])',
5143
5878
  example: "%%=WAT('Omniture', '1234', '5678')=%%",
5879
+ isConfirmed: false,
5880
+ verificationBlocked: true,
5881
+ verificationBlockedReason: 'no-working-invocation',
5144
5882
  },
5145
5883
  {
5146
5884
  name: 'WATP',
@@ -5166,6 +5904,9 @@ export const FUNCTIONS = [
5166
5904
  'The parameter value supplied to the WAT function at the given ordinal position.',
5167
5905
  syntax: 'WATP(ordinal)',
5168
5906
  example: '%%=urlencode(WATP(1))=%%',
5907
+ isConfirmed: false,
5908
+ verificationBlocked: true,
5909
+ verificationBlockedReason: 'no-working-invocation',
5169
5910
  },
5170
5911
  {
5171
5912
  name: 'WrapLongURL',
@@ -5177,10 +5918,17 @@ export const FUNCTIONS = [
5177
5918
  minArgs: 1,
5178
5919
  maxArgs: 1,
5179
5920
  category: 'Utility',
5180
- description: 'Wraps a long URL to prevent line-break issues in email clients.',
5181
- params: [{ name: 'url', description: 'Long URL to wrap', type: 'string' }],
5921
+ description:
5922
+ 'Shortens a long URL for email clients that truncate long hyperlinks. Outside an email send the argument comes back unchanged, so a CloudPage never sees a shortened link.',
5923
+ isConfirmed: true,
5924
+ differsFromOfficialDocs: true,
5925
+ officialDocsNote:
5926
+ 'The official reference states that a URL longer than 975 characters comes back as a shortened link that redirects through the platform. On a live Engagement CloudPage on the child business unit (MID 518005426) a 1048-character URL was returned byte for byte unchanged at the same length, twice in one render, and the same held for a 27-character URL, an empty string and a string that is not a URL at all. The community guide notes that shortening only happens on a send, which the official page does not mention.',
5927
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/wraplongurl/',
5928
+ params: [{ name: 'url', description: 'URL to shorten', type: 'string|number' }],
5182
5929
  returnType: 'string',
5183
- returnDescription: 'A shortened, wrapped form of the supplied long URL.',
5930
+ returnDescription:
5931
+ 'The shortened URL when the call happens during a send; in any other context the supplied value unchanged.',
5184
5932
  syntax: 'WrapLongURL(url)',
5185
5933
  example: "%%=WrapLongURL('https://example.com/a/very/long/path')=%%",
5186
5934
  },
@@ -5290,47 +6038,186 @@ export const deprecatedFunctionLookup = new Map(
5290
6038
  * - `name` the keyword as written in source
5291
6039
  * - `description` short human-readable explanation
5292
6040
  * - `snippet` completion body with `${n:placeholder}` tab stops
6041
+ * - `handlebarsEquivalent` (OPTIONAL): name of the Handlebars helper/construct that plays the
6042
+ * same role, or `null` when the keyword has no counterpart. Handlebars models control flow
6043
+ * and logic as helpers, so language constructs (not just functions) map across.
6044
+ * - `handlebarsNote` (OPTIONAL): human-readable caveat about how the Handlebars construct differs
6045
+ * from the AMPscript keyword. Only set when `handlebarsEquivalent` is non-null.
5293
6046
  *
5294
- * @type {{name: string, description: string, snippet: string}[]}
6047
+ * @type {{name: string, description: string, snippet: string, handlebarsEquivalent?: string | null, handlebarsNote?: string | null}[]}
5295
6048
  */
5296
6049
  export const AMPSCRIPT_KEYWORDS = [
5297
6050
  {
5298
6051
  name: 'var',
5299
6052
  description: 'Declares one or more variables',
5300
6053
  snippet: 'var @${1:variableName}',
6054
+ handlebarsEquivalent: 'set',
6055
+ handlebarsNote: 'Handlebars set is block-scoped and does not persist outside its block.',
5301
6056
  },
5302
6057
  {
5303
6058
  name: 'set',
5304
6059
  description: 'Assigns a value to a variable',
5305
6060
  snippet: 'set @${1:variableName} = ${2:value}',
6061
+ handlebarsEquivalent: 'set',
6062
+ handlebarsNote: 'Handlebars set is block-scoped and does not persist outside its block.',
5306
6063
  },
5307
6064
  {
5308
6065
  name: 'if',
5309
6066
  description: 'Begins a conditional block',
5310
6067
  snippet: 'if ${1:condition} then\n\t${2}\nendif',
6068
+ handlebarsEquivalent: 'if',
6069
+ handlebarsNote: 'elseif/else become {{else if}} / {{else}} inside the same block.',
6070
+ },
6071
+ {
6072
+ name: 'then',
6073
+ description: 'Follows an if/elseif condition',
6074
+ snippet: 'then',
6075
+ handlebarsEquivalent: null,
5311
6076
  },
5312
- { name: 'then', description: 'Follows an if/elseif condition', snippet: 'then' },
5313
6077
  {
5314
6078
  name: 'elseif',
5315
6079
  description: 'Additional condition in an if block',
5316
6080
  snippet: 'elseif ${1:condition} then',
6081
+ handlebarsEquivalent: 'if',
6082
+ handlebarsNote: 'Written as {{else if condition}} inside the enclosing {{#if}} block.',
6083
+ },
6084
+ {
6085
+ name: 'else',
6086
+ description: 'Fallback branch in an if block',
6087
+ snippet: 'else',
6088
+ handlebarsEquivalent: 'if',
6089
+ handlebarsNote: 'Written as {{else}} inside the enclosing {{#if}} block.',
6090
+ },
6091
+ {
6092
+ name: 'endif',
6093
+ description: 'Closes an if block',
6094
+ snippet: 'endif',
6095
+ handlebarsEquivalent: null,
5317
6096
  },
5318
- { name: 'else', description: 'Fallback branch in an if block', snippet: 'else' },
5319
- { name: 'endif', description: 'Closes an if block', snippet: 'endif' },
5320
6097
  {
5321
6098
  name: 'for',
5322
6099
  description: 'Begins a counting loop',
5323
6100
  snippet: 'for @${1:i} = ${2:1} to ${3:rowCount} do\n\t${4}\nnext @${1:i}',
6101
+ handlebarsEquivalent: 'each',
6102
+ handlebarsNote:
6103
+ 'Use {{#repeat}} for a plain counting loop; {{#each}} iterates a collection.',
6104
+ },
6105
+ {
6106
+ name: 'to',
6107
+ description: 'Ascending direction in a for loop',
6108
+ snippet: 'to',
6109
+ handlebarsEquivalent: null,
6110
+ },
6111
+ {
6112
+ name: 'downto',
6113
+ description: 'Descending direction in a for loop',
6114
+ snippet: 'downto',
6115
+ handlebarsEquivalent: null,
6116
+ },
6117
+ {
6118
+ name: 'do',
6119
+ description: 'Marks the start of a loop body',
6120
+ snippet: 'do',
6121
+ handlebarsEquivalent: null,
6122
+ },
6123
+ {
6124
+ name: 'next',
6125
+ description: 'Ends a for loop iteration',
6126
+ snippet: 'next',
6127
+ handlebarsEquivalent: null,
6128
+ },
6129
+ {
6130
+ name: 'and',
6131
+ description: 'Logical AND operator',
6132
+ snippet: 'and',
6133
+ handlebarsEquivalent: 'and',
6134
+ },
6135
+ { name: 'or', description: 'Logical OR operator', snippet: 'or', handlebarsEquivalent: 'or' },
6136
+ {
6137
+ name: 'not',
6138
+ description: 'Logical NOT operator',
6139
+ snippet: 'not',
6140
+ handlebarsEquivalent: 'not',
6141
+ },
6142
+ {
6143
+ name: 'true',
6144
+ description: 'Boolean true constant',
6145
+ snippet: 'true',
6146
+ handlebarsEquivalent: null,
6147
+ },
6148
+ {
6149
+ name: 'false',
6150
+ description: 'Boolean false constant',
6151
+ snippet: 'false',
6152
+ handlebarsEquivalent: null,
6153
+ },
6154
+ ];
6155
+
6156
+ // ── Operators ────────────────────────────────────────────────────────────────
6157
+
6158
+ /**
6159
+ * AMPscript symbolic operator with its Handlebars counterpart. These glyphs are not valid
6160
+ * keyword names (they fail the identifier grammar), so they live in a dedicated export rather
6161
+ * than in AMPSCRIPT_KEYWORDS.
6162
+ * - `name` the operator glyph as written in source
6163
+ * - `category` 'comparison' or 'assignment'
6164
+ * - `description` short human-readable explanation
6165
+ * - `handlebarsEquivalent` name of the Handlebars helper that plays the same role, or `null`
6166
+ * - `handlebarsNote` caveat about how the Handlebars helper is invoked; only set when
6167
+ * `handlebarsEquivalent` is non-null
6168
+ *
6169
+ * @type {{name: string, category: 'comparison' | 'assignment', description: string, handlebarsEquivalent: string | null, handlebarsNote: string | null}[]}
6170
+ */
6171
+ export const AMPSCRIPT_OPERATORS = [
6172
+ {
6173
+ name: '==',
6174
+ category: 'comparison',
6175
+ description: 'Equality comparison',
6176
+ handlebarsEquivalent: 'equals',
6177
+ handlebarsNote: null,
6178
+ },
6179
+ {
6180
+ name: '!=',
6181
+ category: 'comparison',
6182
+ description: 'Inequality comparison',
6183
+ handlebarsEquivalent: 'compare',
6184
+ handlebarsNote: 'Pass "!=" as the operator argument to compare.',
6185
+ },
6186
+ {
6187
+ name: '>',
6188
+ category: 'comparison',
6189
+ description: 'Greater-than comparison',
6190
+ handlebarsEquivalent: 'compare',
6191
+ handlebarsNote: 'Pass ">" as the operator argument to compare.',
6192
+ },
6193
+ {
6194
+ name: '>=',
6195
+ category: 'comparison',
6196
+ description: 'Greater-than-or-equal comparison',
6197
+ handlebarsEquivalent: 'compare',
6198
+ handlebarsNote: 'Pass ">=" as the operator argument to compare.',
6199
+ },
6200
+ {
6201
+ name: '<',
6202
+ category: 'comparison',
6203
+ description: 'Less-than comparison',
6204
+ handlebarsEquivalent: 'compare',
6205
+ handlebarsNote: 'Pass "<" as the operator argument to compare.',
6206
+ },
6207
+ {
6208
+ name: '<=',
6209
+ category: 'comparison',
6210
+ description: 'Less-than-or-equal comparison',
6211
+ handlebarsEquivalent: 'compare',
6212
+ handlebarsNote: 'Pass "<=" as the operator argument to compare.',
6213
+ },
6214
+ {
6215
+ name: '=',
6216
+ category: 'assignment',
6217
+ description: 'Assignment operator (inside set)',
6218
+ handlebarsEquivalent: 'set',
6219
+ handlebarsNote: 'Handlebars set is block-scoped and does not persist outside its block.',
5324
6220
  },
5325
- { name: 'to', description: 'Ascending direction in a for loop', snippet: 'to' },
5326
- { name: 'downto', description: 'Descending direction in a for loop', snippet: 'downto' },
5327
- { name: 'do', description: 'Marks the start of a loop body', snippet: 'do' },
5328
- { name: 'next', description: 'Ends a for loop iteration', snippet: 'next' },
5329
- { name: 'and', description: 'Logical AND operator', snippet: 'and' },
5330
- { name: 'or', description: 'Logical OR operator', snippet: 'or' },
5331
- { name: 'not', description: 'Logical NOT operator', snippet: 'not' },
5332
- { name: 'true', description: 'Boolean true constant', snippet: 'true' },
5333
- { name: 'false', description: 'Boolean false constant', snippet: 'false' },
5334
6221
  ];
5335
6222
 
5336
6223
  // ── Personalization strings ──────────────────────────────────────────────────