ampscript-data 3.2.0 → 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 +17 -5
  2. package/package.json +1 -1
  3. package/src/index.js +1071 -292
package/src/index.js CHANGED
@@ -78,15 +78,31 @@ export const VERIFICATION_BLOCKED_REASONS = Object.freeze([
78
78
  * arguments (2-5 fail) would set `minArgs: 1, maxArgs: 6, validArities: [1, 6]`.
79
79
  * Absent → behavior is a pure contiguous range. No AMPscript function currently needs it.
80
80
  *
81
- @type {{name: string, mcnSince: number | null, mcnNotes: string | null, handlebarsEquivalent?: string | null, mcnHandlebarsGap?: boolean, docUrl?: string, guideUrl?: 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}[]} */
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}[]} */
82
96
  export const FUNCTIONS = [
83
97
  {
84
98
  name: 'Add',
85
99
  mcnSince: 67,
86
100
  handlebarsEquivalent: 'add',
101
+ handlebarsExact: true,
87
102
  mcnNotes: null,
88
103
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-math/mc-ampscript-reference-math-add.html',
89
104
  guideUrl: 'https://ampscript.guide/add/',
105
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/add/',
90
106
  minArgs: 2,
91
107
  maxArgs: 2,
92
108
  category: 'Math',
@@ -233,20 +249,32 @@ export const FUNCTIONS = [
233
249
  {
234
250
  name: 'AttributeValue',
235
251
  mcnSince: null,
236
- handlebarsEquivalent: null,
252
+ handlebarsEquivalent: 'personalizationResult',
253
+ handlebarsExact: false,
237
254
  mcnNotes: null,
238
255
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-utilities/mc-ampscript-reference-utilities-attribute-value.html',
239
256
  guideUrl: 'https://ampscript.guide/attributevalue/',
257
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/attributevalue/',
240
258
  minArgs: 1,
241
259
  maxArgs: 1,
242
260
  category: 'Utility',
243
261
  description:
244
- 'Safely retrieves a subscriber attribute value, returning empty string if null.',
245
- 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
+ ],
246
271
  returnType: 'string',
247
- 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.',
248
274
  syntax: 'AttributeValue(attributeName)',
249
275
  example: "%%=AttributeValue('firstname')=%%",
276
+ isConfirmed: true,
277
+ differsFromOfficialDocs: false,
250
278
  },
251
279
  {
252
280
  name: 'AuthenticatedEmployeeID',
@@ -258,10 +286,15 @@ export const FUNCTIONS = [
258
286
  minArgs: 0,
259
287
  maxArgs: 0,
260
288
  category: 'Utility',
261
- 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.',
262
291
  params: [],
263
292
  returnType: 'string',
264
- 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/',
265
298
  syntax: 'AuthenticatedEmployeeID()',
266
299
  example: '%%=AuthenticatedEmployeeID()=%%',
267
300
  },
@@ -275,10 +308,18 @@ export const FUNCTIONS = [
275
308
  minArgs: 0,
276
309
  maxArgs: 0,
277
310
  category: 'Utility',
278
- 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.',
279
313
  params: [],
280
314
  returnType: 'string',
281
- 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/',
282
323
  syntax: 'AuthenticatedEmployeeNotificationAddress()',
283
324
  example: '%%=AuthenticatedEmployeeNotificationAddress()=%%',
284
325
  },
@@ -292,10 +333,16 @@ export const FUNCTIONS = [
292
333
  minArgs: 0,
293
334
  maxArgs: 0,
294
335
  category: 'Utility',
295
- 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.',
296
338
  params: [],
297
339
  returnType: 'string',
298
- 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/',
299
346
  syntax: 'AuthenticatedEmployeeUserName()',
300
347
  example: '%%=AuthenticatedEmployeeUserName()=%%',
301
348
  },
@@ -309,10 +356,16 @@ export const FUNCTIONS = [
309
356
  minArgs: 0,
310
357
  maxArgs: 0,
311
358
  category: 'Utility',
312
- 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().',
313
361
  params: [],
314
362
  returnType: 'string',
315
- 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/',
316
369
  syntax: 'AuthenticatedEnterpriseID()',
317
370
  example: '%%=AuthenticatedEnterpriseID()=%%',
318
371
  },
@@ -323,13 +376,18 @@ export const FUNCTIONS = [
323
376
  mcnNotes: null,
324
377
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-sites/mc-ampscript-reference-sites-authenticated-member-id.html',
325
378
  guideUrl: 'https://ampscript.guide/authenticatedmemberid/',
379
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/authenticatedmemberid/',
326
380
  minArgs: 0,
327
381
  maxArgs: 0,
328
382
  category: 'Utility',
329
- 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.',
330
385
  params: [],
331
386
  returnType: 'string',
332
- 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,
333
391
  syntax: 'AuthenticatedMemberID()',
334
392
  example: '%%=AuthenticatedMemberID()=%%',
335
393
  },
@@ -340,13 +398,18 @@ export const FUNCTIONS = [
340
398
  mcnNotes: null,
341
399
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-sites/mc-ampscript-reference-sites-authenticated-member-name.html',
342
400
  guideUrl: 'https://ampscript.guide/authenticatedmembername/',
401
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/authenticatedmembername/',
343
402
  minArgs: 0,
344
403
  maxArgs: 0,
345
404
  category: 'Utility',
346
- 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.',
347
407
  params: [],
348
408
  returnType: 'string',
349
- 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,
350
413
  syntax: 'AuthenticatedMemberName()',
351
414
  example: '%%=AuthenticatedMemberName()=%%',
352
415
  },
@@ -445,23 +508,40 @@ export const FUNCTIONS = [
445
508
  minArgs: 1,
446
509
  maxArgs: 3,
447
510
  category: 'Encryption and Encoding',
448
- 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.',
449
513
  params: [
450
- { name: 'encodedString', description: 'Base64 string to decode', type: 'string' },
451
- { name: 'encoding', description: 'Encoding scheme', type: 'string', optional: true },
452
514
  {
453
- 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',
454
531
  mcnSince: null,
455
532
  mcnNotes: null,
456
- description: 'Character set for output',
457
- 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',
458
536
  optional: true,
459
537
  },
460
538
  ],
461
539
  returnType: 'string',
462
540
  returnDescription: 'The decoded string.',
463
- syntax: 'Base64Decode(encodedString[, encoding, characterSet])',
541
+ syntax: 'Base64Decode(encodedString[, encoding, abortOnFailure])',
464
542
  example: "%%=Base64Decode('SGVsbG8=')=%%",
543
+ isConfirmed: true,
544
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/base64decode/',
465
545
  },
466
546
  {
467
547
  name: 'Base64Encode',
@@ -473,15 +553,31 @@ export const FUNCTIONS = [
473
553
  minArgs: 1,
474
554
  maxArgs: 2,
475
555
  category: 'Encryption and Encoding',
476
- 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.',
477
558
  params: [
478
- { name: 'value', description: 'Value to encode', type: 'string' },
479
- { 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
+ },
480
573
  ],
481
574
  returnType: 'string',
482
- 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.',
483
577
  syntax: 'Base64Encode(value[, encoding])',
484
578
  example: "%%=Base64Encode('Hello')=%%",
579
+ isConfirmed: true,
580
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/base64encode/',
485
581
  },
486
582
  {
487
583
  name: 'BeginImpressionRegion',
@@ -560,10 +656,12 @@ export const FUNCTIONS = [
560
656
  {
561
657
  name: 'BuildRowsetFromJSON',
562
658
  mcnSince: 67,
563
- handlebarsEquivalent: null,
659
+ handlebarsEquivalent: 'jsonPath',
660
+ handlebarsExact: false,
564
661
  mcnNotes: null,
565
662
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-content/mc-ampscript-reference-content-build-rowset-from-json.html',
566
663
  guideUrl: 'https://ampscript.guide/buildrowsetfromjson/',
664
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/buildrowsetfromjson/',
567
665
  minArgs: 3,
568
666
  maxArgs: 3,
569
667
  category: 'Content',
@@ -586,14 +684,19 @@ export const FUNCTIONS = [
586
684
  mcnSince: null,
587
685
  mcnNotes: null,
588
686
  description:
589
- 'If false, return an empty rowset on a syntax error; if true, raise an exception',
590
- 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',
591
689
  },
592
690
  ],
593
691
  returnType: 'rowset',
594
- 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.',
595
694
  syntax: 'BuildRowsetFromJSON(jsonData, jsonPathExpression, returnEmptyOnError)',
596
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.',
597
700
  },
598
701
  {
599
702
  name: 'BuildRowSetFromString',
@@ -602,6 +705,7 @@ export const FUNCTIONS = [
602
705
  mcnNotes: null,
603
706
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-content/mc-ampscript-reference-content-build-rowset-from-string.html',
604
707
  guideUrl: 'https://ampscript.guide/buildrowsetfromstring/',
708
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/buildrowsetfromstring/',
605
709
  minArgs: 2,
606
710
  maxArgs: 2,
607
711
  category: 'Content',
@@ -614,15 +718,18 @@ export const FUNCTIONS = [
614
718
  },
615
719
  {
616
720
  name: 'delimiter',
617
- 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',
618
723
  type: 'string',
619
724
  },
620
725
  ],
621
726
  returnType: 'rowset',
622
727
  returnDescription:
623
- '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.',
624
729
  syntax: 'BuildRowSetFromString(sourceData, delimiter)',
625
730
  example: "%%=BuildRowSetFromString('a,b,c', ',')=%%",
731
+ isConfirmed: true,
732
+ differsFromOfficialDocs: false,
626
733
  },
627
734
  {
628
735
  name: 'BuildRowSetFromXML',
@@ -631,6 +738,7 @@ export const FUNCTIONS = [
631
738
  mcnNotes: null,
632
739
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-content/mc-ampscript-reference-content-build-rowset-from-xml.html',
633
740
  guideUrl: 'https://ampscript.guide/buildrowsetfromxml/',
741
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/buildrowsetfromxml/',
634
742
  minArgs: 3,
635
743
  maxArgs: 3,
636
744
  category: 'Content',
@@ -647,41 +755,56 @@ export const FUNCTIONS = [
647
755
  mcnSince: null,
648
756
  mcnNotes: null,
649
757
  description:
650
- 'If false, return an empty rowset on a syntax error; if true, raise an exception',
651
- 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',
652
760
  },
653
761
  ],
654
762
  returnType: 'rowset',
655
- 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.',
656
765
  syntax: 'BuildRowSetFromXML(xmlData, xpathExpression, returnEmptyOnError)',
657
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.',
658
771
  },
659
772
  {
660
773
  name: 'Char',
661
774
  mcnSince: null,
662
- handlebarsEquivalent: null,
775
+ handlebarsEquivalent: 'char',
776
+ handlebarsExact: true,
663
777
  mcnNotes: null,
664
778
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-string/mc-ampscript-reference-string-char.html',
665
779
  guideUrl: 'https://ampscript.guide/char/',
666
780
  minArgs: 1,
667
781
  maxArgs: 2,
668
782
  category: 'String',
669
- 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.',
670
785
  params: [
671
- { 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
+ },
672
791
  {
673
792
  name: 'numRepetitions',
674
793
  mcnSince: null,
675
794
  mcnNotes: null,
676
- description: 'Number of times to repeat the returned character',
677
- type: 'number',
795
+ description: 'Number of times to repeat the returned character, as a whole number',
796
+ type: 'string|number',
678
797
  optional: true,
679
798
  },
680
799
  ],
681
800
  returnType: 'string',
682
- 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.',
683
803
  syntax: 'Char(characterCode[, numRepetitions])',
684
804
  example: '%%=Char(10)=%%',
805
+ isConfirmed: true,
806
+ differsFromOfficialDocs: false,
807
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/char/',
685
808
  },
686
809
  {
687
810
  name: 'ClaimRow',
@@ -820,7 +943,10 @@ export const FUNCTIONS = [
820
943
  maxArgs: INF,
821
944
  category: 'Utility',
822
945
  description:
823
- '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/',
824
950
  params: [
825
951
  {
826
952
  name: 'pageId',
@@ -854,7 +980,7 @@ export const FUNCTIONS = [
854
980
  ],
855
981
  returnType: 'string',
856
982
  returnDescription:
857
- '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.',
858
984
  repeat: [{ startIndex: 1, groupSize: 2, minGroups: 0 }],
859
985
  syntax: 'CloudPagesURL(pageId[, paramName1, paramValue1, paramNameN, paramValueN, ...])',
860
986
  example: "%%=CloudPagesURL(123, 'key', 'value')=%%",
@@ -863,9 +989,11 @@ export const FUNCTIONS = [
863
989
  name: 'Concat',
864
990
  mcnSince: 67,
865
991
  handlebarsEquivalent: 'concat',
992
+ handlebarsExact: true,
866
993
  mcnNotes: null,
867
994
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-string/mc-ampscript-reference-string-concat.html',
868
995
  guideUrl: 'https://ampscript.guide/concat/',
996
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/concat/',
869
997
  minArgs: 1,
870
998
  maxArgs: INF,
871
999
  isConfirmed: true,
@@ -1023,7 +1151,6 @@ export const FUNCTIONS = [
1023
1151
  name: 'ContentBlockByID',
1024
1152
  mcnSince: 67,
1025
1153
  handlebarsEquivalent: null,
1026
- mcnHandlebarsGap: true,
1027
1154
  mcnNotes: null,
1028
1155
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-content/mc-ampscript-reference-content-block-by-id.html',
1029
1156
  guideUrl: 'https://ampscript.guide/contentblockbyid/',
@@ -1082,8 +1209,8 @@ export const FUNCTIONS = [
1082
1209
  {
1083
1210
  name: 'ContentBlockByKey',
1084
1211
  mcnSince: 67,
1085
- handlebarsEquivalent: null,
1086
- mcnHandlebarsGap: true,
1212
+ handlebarsEquivalent: 'getContentBlock',
1213
+ handlebarsExact: false,
1087
1214
  mcnNotes: null,
1088
1215
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-content/mc-ampscript-reference-content-block-by-key.html',
1089
1216
  guideUrl: 'https://ampscript.guide/contentblockbykey/',
@@ -1143,7 +1270,6 @@ export const FUNCTIONS = [
1143
1270
  name: 'ContentBlockByName',
1144
1271
  mcnSince: 67,
1145
1272
  handlebarsEquivalent: null,
1146
- mcnHandlebarsGap: true,
1147
1273
  mcnNotes: null,
1148
1274
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-content/mc-ampscript-reference-content-block-by-name.html',
1149
1275
  guideUrl: 'https://ampscript.guide/contentblockbyname/',
@@ -1424,25 +1550,41 @@ export const FUNCTIONS = [
1424
1550
  name: 'DateAdd',
1425
1551
  mcnSince: 67,
1426
1552
  handlebarsEquivalent: 'dateAdd',
1553
+ handlebarsExact: true,
1427
1554
  mcnNotes: null,
1428
1555
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-date-time/mc-ampscript-reference-date-time-date-add.html',
1429
1556
  guideUrl: 'https://ampscript.guide/dateadd/',
1557
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/dateadd/',
1558
+ isConfirmed: true,
1559
+ differsFromOfficialDocs: false,
1430
1560
  minArgs: 3,
1431
1561
  maxArgs: 3,
1432
1562
  category: 'Date and Time',
1433
- 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.',
1434
1565
  params: [
1435
- { name: 'date', description: 'Base date', type: 'date' },
1436
- { 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
+ },
1437
1578
  {
1438
1579
  name: 'unitToAdd',
1439
1580
  description:
1440
- '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',
1441
1582
  type: 'string',
1442
1583
  },
1443
1584
  ],
1444
1585
  returnType: 'date',
1445
- 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.',
1446
1588
  syntax: 'DateAdd(date, amountToAdd, unitToAdd)',
1447
1589
  example: "%%=DateAdd(Now(), 7, 'D')=%%",
1448
1590
  },
@@ -1450,36 +1592,44 @@ export const FUNCTIONS = [
1450
1592
  name: 'DateDiff',
1451
1593
  mcnSince: 67,
1452
1594
  handlebarsEquivalent: 'dateDiff',
1595
+ handlebarsExact: true,
1453
1596
  mcnNotes: null,
1454
1597
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-date-time/mc-ampscript-reference-date-time-date-diff.html',
1455
1598
  guideUrl: 'https://ampscript.guide/datediff/',
1456
1599
  minArgs: 3,
1457
1600
  maxArgs: 3,
1458
1601
  category: 'Date and Time',
1459
- 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.',
1460
1604
  params: [
1461
1605
  {
1462
1606
  name: 'startDate',
1463
- description: 'The starting date for the comparison',
1464
- type: 'date',
1607
+ description:
1608
+ 'The starting date, either a real date value or a parseable date string',
1609
+ type: 'string|date',
1465
1610
  },
1466
1611
  {
1467
1612
  name: 'endDate',
1468
- description: 'The end date; the function subtracts startDate from endDate',
1469
- 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',
1470
1616
  },
1471
1617
  {
1472
1618
  name: 'unitOfDifference',
1473
- 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',
1474
1621
  type: 'string',
1475
1622
  enum: ['Y', 'M', 'D', 'H', 'MI'],
1476
1623
  },
1477
1624
  ],
1478
1625
  returnType: 'number',
1479
1626
  returnDescription:
1480
- '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.',
1481
1628
  syntax: 'DateDiff(startDate, endDate, unitOfDifference)',
1482
1629
  example: "%%=DateDiff(Now(), DateAdd(Now(), 1, 'D'), 'MI')=%%",
1630
+ isConfirmed: true,
1631
+ differsFromOfficialDocs: false,
1632
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/datediff/',
1483
1633
  },
1484
1634
  {
1485
1635
  name: 'DateParse',
@@ -1491,26 +1641,32 @@ export const FUNCTIONS = [
1491
1641
  minArgs: 1,
1492
1642
  maxArgs: 2,
1493
1643
  category: 'Date and Time',
1494
- 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/',
1495
1649
  params: [
1496
1650
  {
1497
1651
  name: 'dateString',
1498
- description: 'A string that contains a date or timestamp',
1499
- 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',
1500
1655
  },
1501
1656
  {
1502
1657
  name: 'useUtc',
1503
1658
  mcnSince: null,
1504
1659
  mcnNotes: null,
1505
1660
  description:
1506
- 'If true, return the date and time in UTC; if false, use the Business Unit local time',
1507
- 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',
1508
1663
  optional: true,
1509
1664
  default: false,
1510
1665
  },
1511
1666
  ],
1512
1667
  returnType: 'date',
1513
- 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.',
1514
1670
  syntax: 'DateParse(dateString[, useUtc])',
1515
1671
  example: "%%=DateParse('2026-01-15T08:30:00', 1)=%%",
1516
1672
  },
@@ -1524,18 +1680,24 @@ export const FUNCTIONS = [
1524
1680
  minArgs: 2,
1525
1681
  maxArgs: 2,
1526
1682
  category: 'Date and Time',
1527
- 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/',
1528
1688
  params: [
1529
1689
  {
1530
1690
  name: 'dateString',
1531
- description: 'A string that contains a date or timestamp',
1532
- 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',
1533
1694
  },
1534
1695
  {
1535
1696
  name: 'datePart',
1536
1697
  mcnSince: null,
1537
1698
  mcnNotes: null,
1538
- description: 'The date part to extract from the string',
1699
+ description:
1700
+ 'The component to extract, case-insensitive. Any other value aborts the page',
1539
1701
  type: 'string',
1540
1702
  enum: [
1541
1703
  'year',
@@ -1554,7 +1716,7 @@ export const FUNCTIONS = [
1554
1716
  ],
1555
1717
  returnType: 'string',
1556
1718
  returnDescription:
1557
- '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.',
1558
1720
  syntax: 'DatePart(dateString, datePart)',
1559
1721
  example: "%%=DatePart('2026-01-15', 'Y')=%%",
1560
1722
  },
@@ -1568,10 +1730,23 @@ export const FUNCTIONS = [
1568
1730
  minArgs: 8,
1569
1731
  maxArgs: 8,
1570
1732
  category: 'Encryption and Encoding',
1571
- 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.',
1572
1737
  params: [
1573
- { name: 'encryptedValue', description: 'Value to decrypt', type: 'string' },
1574
- { 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
+ },
1575
1750
  {
1576
1751
  name: 'passwordExternalKey',
1577
1752
  mcnSince: null,
@@ -1734,9 +1909,11 @@ export const FUNCTIONS = [
1734
1909
  name: 'Divide',
1735
1910
  mcnSince: 67,
1736
1911
  handlebarsEquivalent: 'divide',
1912
+ handlebarsExact: true,
1737
1913
  mcnNotes: null,
1738
1914
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-math/mc-ampscript-reference-math-divide.html',
1739
1915
  guideUrl: 'https://ampscript.guide/divide/',
1916
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/divide/',
1740
1917
  minArgs: 2,
1741
1918
  maxArgs: 2,
1742
1919
  category: 'Math',
@@ -1760,13 +1937,24 @@ export const FUNCTIONS = [
1760
1937
  mcnNotes: null,
1761
1938
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-utilities/mc-ampscript-reference-utilities-domain.html',
1762
1939
  guideUrl: 'https://ampscript.guide/domain/',
1940
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/domain/',
1763
1941
  minArgs: 1,
1764
1942
  maxArgs: 1,
1943
+ isConfirmed: true,
1944
+ differsFromOfficialDocs: false,
1765
1945
  category: 'Utility',
1766
- description: 'Extracts the domain portion from an email address.',
1767
- 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
+ ],
1768
1955
  returnType: 'string',
1769
- 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.',
1770
1958
  syntax: 'Domain(emailAddress)',
1771
1959
  example: "%%=Domain('user@example.com')=%%",
1772
1960
  },
@@ -1774,17 +1962,28 @@ export const FUNCTIONS = [
1774
1962
  name: 'Empty',
1775
1963
  mcnSince: 67,
1776
1964
  handlebarsEquivalent: 'isEmpty',
1965
+ handlebarsExact: true,
1777
1966
  mcnNotes: null,
1778
1967
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-utilities/mc-ampscript-reference-utilities-empty.html',
1779
1968
  guideUrl: 'https://ampscript.guide/empty/',
1969
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/empty/',
1780
1970
  minArgs: 1,
1781
1971
  maxArgs: 1,
1782
1972
  category: 'Utility',
1783
- description: 'Returns true if the value is empty, null, or not defined.',
1784
- 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
+ ],
1785
1983
  returnType: 'boolean',
1786
- returnDescription: 'True when the value is empty or null, otherwise false.',
1984
+ returnDescription: 'True when the value is empty or missing, otherwise false.',
1787
1985
  returnEnum: [true, false],
1986
+ isConfirmed: true,
1788
1987
  syntax: 'Empty(value)',
1789
1988
  example: '%%=Empty(@myVar)=%%',
1790
1989
  },
@@ -1798,10 +1997,19 @@ export const FUNCTIONS = [
1798
1997
  minArgs: 8,
1799
1998
  maxArgs: 8,
1800
1999
  category: 'Encryption and Encoding',
1801
- 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.',
1802
2004
  params: [
1803
2005
  { name: 'value', description: 'Value to encrypt', type: 'string' },
1804
- { 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
+ },
1805
2013
  {
1806
2014
  name: 'passwordExternalKey',
1807
2015
  mcnSince: null,
@@ -1834,7 +2042,7 @@ export const FUNCTIONS = [
1834
2042
  { name: 'iv', description: 'IV value or empty to use external key', type: 'string' },
1835
2043
  ],
1836
2044
  returnType: 'string',
1837
- returnDescription: 'The encrypted value.',
2045
+ returnDescription: 'The ciphertext, Base64-encoded.',
1838
2046
  syntax: 'EncryptSymmetric(value, algorithm, passwordExternalKey, password, saltExternalKey, salt, ivExternalKey, iv)',
1839
2047
  example: "%%=EncryptSymmetric('secret', 'aes', 'pwKey', '', 'saltKey', '', 'ivKey', '')=%%",
1840
2048
  },
@@ -1948,7 +2156,8 @@ export const FUNCTIONS = [
1948
2156
  {
1949
2157
  name: 'Field',
1950
2158
  mcnSince: 67,
1951
- handlebarsEquivalent: null,
2159
+ handlebarsEquivalent: 'get',
2160
+ handlebarsExact: false,
1952
2161
  mcnNotes: null,
1953
2162
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-data-extension/mc-ampscript-reference-data-extension-field.html',
1954
2163
  guideUrl: 'https://ampscript.guide/field/',
@@ -1979,52 +2188,92 @@ export const FUNCTIONS = [
1979
2188
  name: 'Format',
1980
2189
  mcnSince: 67,
1981
2190
  handlebarsEquivalent: 'format',
2191
+ handlebarsExact: false,
1982
2192
  mcnNotes: null,
1983
2193
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-string/mc-ampscript-reference-string-format.html',
1984
2194
  guideUrl: 'https://ampscript.guide/format/',
1985
2195
  minArgs: 2,
1986
2196
  maxArgs: 4,
1987
2197
  category: 'Utility',
1988
- 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.',
1989
2205
  params: [
1990
- { name: 'value', description: 'Value to format' },
1991
- { name: 'formatString', description: '.NET format string', type: 'string' },
1992
2206
  {
1993
- 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',
1994
2220
  mcnSince: null,
1995
2221
  mcnNotes: null,
1996
- 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',
1997
2231
  type: 'string',
1998
2232
  optional: true,
1999
2233
  },
2000
- { name: 'timeZone', description: 'Target time zone', type: 'string', optional: true },
2001
2234
  ],
2002
2235
  returnType: 'string',
2003
- returnDescription: 'The formatted string representation of the value.',
2004
- syntax: 'Format(value, formatString[, culture, timeZone])',
2005
- 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")=%%',
2006
2240
  },
2007
2241
  {
2008
2242
  name: 'FormatCurrency',
2009
2243
  mcnSince: 67,
2010
2244
  handlebarsEquivalent: 'formatCurrency',
2245
+ handlebarsExact: false,
2011
2246
  mcnNotes: null,
2012
2247
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-utilities/mc-ampscript-reference-utilities-formatCurrency.html',
2013
2248
  guideUrl: 'https://ampscript.guide/formatcurrency/',
2014
2249
  minArgs: 2,
2015
2250
  maxArgs: 4,
2016
2251
  category: 'Utility',
2017
- 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.',
2018
2257
  params: [
2019
- { name: 'value', description: 'Numeric value', type: 'number' },
2020
- { 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
+ },
2021
2270
  {
2022
2271
  name: 'decimalPlaces',
2023
2272
  mcnSince: null,
2024
2273
  mcnNotes: null,
2025
2274
  description:
2026
- 'Number of decimal places; defaults to 2 when omitted (locale-dependent rounding may apply)',
2027
- 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',
2028
2277
  optional: true,
2029
2278
  default: 2,
2030
2279
  },
@@ -2032,20 +2281,22 @@ export const FUNCTIONS = [
2032
2281
  name: 'symbol',
2033
2282
  mcnSince: null,
2034
2283
  mcnNotes: null,
2035
- 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",
2036
2286
  type: 'string',
2037
2287
  optional: true,
2038
2288
  },
2039
2289
  ],
2040
2290
  returnType: 'string',
2041
- returnDescription: 'The value formatted as a localized currency string.',
2291
+ returnDescription: 'The amount formatted as a currency string for the requested locale.',
2042
2292
  syntax: 'FormatCurrency(value, locale[, decimalPlaces, symbol])',
2043
- example: "%%=FormatCurrency(1234.5, 'en-US', 2, '$')=%%",
2293
+ example: "%%=FormatCurrency(1234.555, 'en-US')=%%",
2044
2294
  },
2045
2295
  {
2046
2296
  name: 'FormatDate',
2047
2297
  mcnSince: 67,
2048
- handlebarsEquivalent: null,
2298
+ handlebarsEquivalent: 'format',
2299
+ handlebarsExact: false,
2049
2300
  mcnNotes:
2050
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").',
2051
2302
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-date-time/mc-ampscript-reference-date-time-format-date.html',
@@ -2053,37 +2304,47 @@ export const FUNCTIONS = [
2053
2304
  minArgs: 1,
2054
2305
  maxArgs: 4,
2055
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/',
2056
2312
  description:
2057
- '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.',
2058
2314
  params: [
2059
2315
  {
2060
2316
  name: 'dateString',
2061
- description: 'The date string that you want to format',
2062
- type: 'string',
2317
+ description:
2318
+ 'The date to format, either a real date value or a parseable date string',
2319
+ type: 'string|date',
2063
2320
  },
2064
2321
  {
2065
2322
  name: 'dateFormat',
2066
2323
  mcnSince: 67,
2067
2324
  mcnNotes: null,
2068
- 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',
2069
2327
  type: 'string',
2070
2328
  optional: true,
2071
2329
  },
2072
2330
  {
2073
2331
  name: 'timeFormat',
2074
- 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',
2075
2334
  type: 'string',
2076
2335
  optional: true,
2077
2336
  },
2078
2337
  {
2079
2338
  name: 'localeCode',
2080
- 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',
2081
2341
  type: 'string',
2082
2342
  optional: true,
2083
2343
  },
2084
2344
  ],
2085
2345
  returnType: 'string',
2086
- 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.',
2087
2348
  syntax: 'FormatDate(dateString[, dateFormat, timeFormat, localeCode])',
2088
2349
  example: '%%=FormatDate(Now(), "dddd, MMMM d yyyy", "HH:mm:ss")=%%',
2089
2350
  },
@@ -2091,22 +2352,43 @@ export const FUNCTIONS = [
2091
2352
  name: 'FormatNumber',
2092
2353
  mcnSince: 67,
2093
2354
  handlebarsEquivalent: 'formatNumber',
2355
+ handlebarsExact: true,
2094
2356
  mcnNotes: null,
2095
2357
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-utilities/mc-ampscript-reference-utilities-formatNumber.html',
2096
2358
  guideUrl: 'https://ampscript.guide/formatnumber/',
2097
2359
  minArgs: 2,
2098
2360
  maxArgs: 3,
2099
2361
  category: 'Utility',
2100
- 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.',
2101
2367
  params: [
2102
- { name: 'number', description: 'Numeric value to format', type: 'number' },
2103
- { name: 'format', description: 'Format pattern (e.g. N2, C0)', type: 'string' },
2104
- { 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
+ },
2105
2387
  ],
2106
2388
  returnType: 'string',
2107
- returnDescription: 'The number formatted according to the supplied format string.',
2389
+ returnDescription: 'The number formatted according to the supplied pattern.',
2108
2390
  syntax: 'FormatNumber(number, format[, locale])',
2109
- example: "%%=FormatNumber(1234.567, 'N2', 'en-US')=%%",
2391
+ example: "%%=FormatNumber(1234.555, 'N2', 'de-DE')=%%",
2110
2392
  },
2111
2393
  {
2112
2394
  name: 'GetJWT',
@@ -2118,24 +2400,34 @@ export const FUNCTIONS = [
2118
2400
  minArgs: 3,
2119
2401
  maxArgs: 3,
2120
2402
  category: 'Encryption and Encoding',
2121
- 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.',
2122
2405
  params: [
2123
- { 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
+ },
2124
2412
  {
2125
2413
  name: 'algorithm',
2126
- description: 'Hashing algorithm',
2414
+ description:
2415
+ 'HMAC algorithm name, matched case-insensitively; an unknown name aborts the page',
2127
2416
  type: 'string',
2128
2417
  enum: ['HS256', 'HS384', 'HS512'],
2129
2418
  },
2130
2419
  {
2131
2420
  name: 'jsonPayload',
2132
2421
  description:
2133
- "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.',
2134
2423
  type: 'string',
2135
2424
  },
2136
2425
  ],
2137
2426
  returnType: 'string',
2138
- 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/',
2139
2431
  syntax: 'GetJWT(secret, algorithm, jsonPayload)',
2140
2432
  example: "%%=GetJWT(@secret, 'HS256', @payload)=%%",
2141
2433
  },
@@ -2167,6 +2459,9 @@ export const FUNCTIONS = [
2167
2459
  ],
2168
2460
  returnType: 'string',
2169
2461
  returnDescription: 'A signed JSON Web Token string created with the named key.',
2462
+ isConfirmed: false,
2463
+ verificationBlocked: true,
2464
+ verificationBlockedReason: 'no-test-data',
2170
2465
  syntax: 'GetJWTByKeyName(keyName, algorithm, jsonPayload)',
2171
2466
  example: "%%=GetJWTByKeyName('MyKeyName', 'HS256', @payload)=%%",
2172
2467
  },
@@ -2223,21 +2518,29 @@ export const FUNCTIONS = [
2223
2518
  maxArgs: 1,
2224
2519
  category: 'Date and Time',
2225
2520
  description:
2226
- '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.',
2227
2522
  params: [
2228
2523
  {
2229
- name: 'persistFormat',
2524
+ name: 'boolAllSubscribers',
2230
2525
  mcnSince: null,
2231
2526
  mcnNotes: null,
2232
- description: 'Persist date format flag',
2233
- 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',
2234
2530
  optional: true,
2235
2531
  },
2236
2532
  ],
2237
2533
  returnType: 'date',
2238
- returnDescription: 'The send time of the message as a date value.',
2239
- 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])',
2240
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.',
2241
2544
  },
2242
2545
  {
2243
2546
  name: 'GetSocialPublishURL',
@@ -2355,15 +2658,20 @@ export const FUNCTIONS = [
2355
2658
  mcnNotes: null,
2356
2659
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-utilities/mc-ampscript-reference-utilities-guid.html',
2357
2660
  guideUrl: 'https://ampscript.guide/guid/',
2661
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/guid/',
2358
2662
  minArgs: 0,
2359
2663
  maxArgs: 0,
2360
2664
  category: 'Utility',
2361
- 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.',
2362
2667
  params: [],
2363
2668
  returnType: 'string',
2364
- 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.',
2365
2671
  syntax: 'GUID()',
2366
2672
  example: '%%=GUID()=%%',
2673
+ isConfirmed: true,
2674
+ differsFromOfficialDocs: false,
2367
2675
  },
2368
2676
  {
2369
2677
  name: 'HTTPGet',
@@ -2666,21 +2974,38 @@ export const FUNCTIONS = [
2666
2974
  name: 'IIf',
2667
2975
  mcnSince: 67,
2668
2976
  handlebarsEquivalent: 'iif',
2977
+ handlebarsExact: true,
2669
2978
  mcnNotes: null,
2670
2979
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-utilities/mc-ampscript-reference-utilities-iif.html',
2671
2980
  guideUrl: 'https://ampscript.guide/iif/',
2981
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/iif/',
2672
2982
  minArgs: 3,
2673
2983
  maxArgs: 3,
2674
2984
  category: 'Utility',
2675
- 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.',
2676
2987
  params: [
2677
- { name: 'expression', description: 'Boolean expression to evaluate', type: 'boolean' },
2678
- { name: 'trueValue', description: 'Value returned when true' },
2679
- { 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
+ },
2680
3004
  ],
2681
3005
  returnType: 'string',
2682
3006
  returnDescription:
2683
3007
  'The second argument when the condition is true, otherwise the third argument.',
3008
+ isConfirmed: true,
2684
3009
  syntax: 'IIf(expression, trueValue, falseValue)',
2685
3010
  example: "%%=IIf(Empty(@name), 'Friend', @name)=%%",
2686
3011
  },
@@ -2722,21 +3047,36 @@ export const FUNCTIONS = [
2722
3047
  name: 'IndexOf',
2723
3048
  mcnSince: 67,
2724
3049
  handlebarsEquivalent: 'indexOf',
3050
+ handlebarsExact: false,
2725
3051
  mcnNotes: null,
2726
3052
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-string/mc-ampscript-reference-string-index-of.html',
2727
3053
  guideUrl: 'https://ampscript.guide/indexof/',
3054
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/indexof/',
2728
3055
  minArgs: 2,
2729
- maxArgs: 2,
3056
+ maxArgs: 3,
2730
3057
  category: 'String',
2731
- 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.',
2732
3060
  params: [
2733
- { name: 'sourceString', description: 'String to search in', type: 'string' },
2734
- { 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
+ },
2735
3072
  ],
2736
3073
  returnType: 'number',
2737
- returnDescription: 'The 1-based position of the substring, or 0 when it is not found.',
2738
- 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])',
2739
3077
  example: "%%=IndexOf('Hello World', 'World')=%%",
3078
+ isConfirmed: true,
3079
+ differsFromOfficialDocs: false,
2740
3080
  },
2741
3081
  {
2742
3082
  name: 'InsertData',
@@ -3061,12 +3401,22 @@ export const FUNCTIONS = [
3061
3401
  mcnNotes: null,
3062
3402
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-http/mc-ampscript-reference-http-is-chtml-browser.html',
3063
3403
  guideUrl: 'https://ampscript.guide/ischtmlbrowser/',
3404
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/ischtmlbrowser/',
3064
3405
  minArgs: 1,
3065
3406
  maxArgs: 1,
3407
+ isConfirmed: true,
3408
+ differsFromOfficialDocs: false,
3066
3409
  category: 'Utility',
3067
3410
  description:
3068
- "Returns true if the subscriber's browser is identified as a compact HTML (cHTML) device.",
3069
- 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
+ ],
3070
3420
  returnType: 'boolean',
3071
3421
  returnDescription: 'True when the user agent indicates a cHTML browser, otherwise false.',
3072
3422
  returnEnum: [true, false],
@@ -3080,11 +3430,24 @@ export const FUNCTIONS = [
3080
3430
  mcnNotes: null,
3081
3431
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-utilities/mc-ampscript-reference-utilities-is-email-address.html',
3082
3432
  guideUrl: 'https://ampscript.guide/isemailaddress/',
3433
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/isemailaddress/',
3083
3434
  minArgs: 1,
3084
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.',
3085
3440
  category: 'Utility',
3086
- description: 'Returns true if the value is a syntactically valid email address.',
3087
- 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
+ ],
3088
3451
  returnType: 'boolean',
3089
3452
  returnDescription:
3090
3453
  'True when the value is a syntactically valid email address, otherwise false.',
@@ -3095,38 +3458,65 @@ export const FUNCTIONS = [
3095
3458
  {
3096
3459
  name: 'IsNull',
3097
3460
  mcnSince: 67,
3098
- handlebarsEquivalent: null,
3461
+ handlebarsEquivalent: 'isEmpty',
3462
+ handlebarsExact: false,
3099
3463
  mcnNotes: null,
3100
3464
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-utilities/mc-ampscript-reference-utilities-is-null.html',
3101
3465
  guideUrl: 'https://ampscript.guide/isnull/',
3466
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/isnull/',
3102
3467
  minArgs: 1,
3103
3468
  maxArgs: 1,
3104
3469
  category: 'Utility',
3105
- description: 'Returns true if the value is null.',
3106
- 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
+ ],
3107
3480
  returnType: 'boolean',
3108
- returnDescription: 'True when the value is null, otherwise false.',
3109
- 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.',
3110
3487
  syntax: 'IsNull(value)',
3111
3488
  example: '%%=IsNull(@value)=%%',
3112
3489
  },
3113
3490
  {
3114
3491
  name: 'IsNullDefault',
3115
3492
  mcnSince: null,
3116
- handlebarsEquivalent: null,
3493
+ handlebarsEquivalent: 'fallback',
3494
+ handlebarsExact: false,
3117
3495
  mcnNotes: null,
3118
3496
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-sites/mc-ampscript-reference-sites-is-null-default.html',
3119
3497
  guideUrl: 'https://ampscript.guide/isnulldefault/',
3498
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/isnulldefault/',
3120
3499
  minArgs: 2,
3121
3500
  maxArgs: 2,
3122
3501
  category: 'Utility',
3123
- 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.',
3124
3504
  params: [
3125
- { name: 'value', description: 'Value to test' },
3126
- { 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
+ },
3127
3516
  ],
3128
3517
  returnType: 'string',
3129
3518
  returnDescription: 'The original value, or the default value when the original is null.',
3519
+ isConfirmed: true,
3130
3520
  syntax: 'IsNullDefault(value, defaultValue)',
3131
3521
  example: "%%=IsNullDefault(@name, 'Friend')=%%",
3132
3522
  },
@@ -3137,24 +3527,37 @@ export const FUNCTIONS = [
3137
3527
  mcnNotes: null,
3138
3528
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-utilities/mc-ampscript-reference-utilities-is-phone-number.html',
3139
3529
  guideUrl: 'https://ampscript.guide/isphonenumber/',
3530
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/isphonenumber/',
3140
3531
  minArgs: 1,
3141
3532
  maxArgs: 1,
3533
+ isConfirmed: true,
3534
+ differsFromOfficialDocs: false,
3142
3535
  category: 'Utility',
3143
- description: 'Returns true if the value is a valid phone number.',
3144
- 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
+ ],
3145
3546
  returnType: 'boolean',
3146
3547
  returnDescription: 'True when the value is a valid phone number, otherwise false.',
3147
3548
  returnEnum: [true, false],
3148
3549
  syntax: 'IsPhoneNumber(value)',
3149
- example: "%%=IsPhoneNumber('+1 718 209 7651')=%%",
3550
+ example: "%%=IsPhoneNumber('425-555-0142')=%%",
3150
3551
  },
3151
3552
  {
3152
3553
  name: 'Length',
3153
3554
  mcnSince: 67,
3154
3555
  handlebarsEquivalent: 'length',
3556
+ handlebarsExact: true,
3155
3557
  mcnNotes: null,
3156
3558
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-string/mc-ampscript-reference-string-length.html',
3157
3559
  guideUrl: 'https://ampscript.guide/length/',
3560
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/length/',
3158
3561
  minArgs: 1,
3159
3562
  maxArgs: 1,
3160
3563
  isConfirmed: true,
@@ -3207,25 +3610,32 @@ export const FUNCTIONS = [
3207
3610
  {
3208
3611
  name: 'LocalDateToSystemDate',
3209
3612
  mcnSince: null,
3210
- handlebarsEquivalent: null,
3613
+ handlebarsEquivalent: 'timeZoneConversion',
3614
+ handlebarsExact: false,
3211
3615
  mcnNotes: null,
3212
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',
3213
3617
  guideUrl: 'https://ampscript.guide/localdatetosystemdate/',
3214
3618
  minArgs: 1,
3215
3619
  maxArgs: 1,
3216
3620
  category: 'Date and Time',
3217
- 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.',
3218
3623
  params: [
3219
3624
  {
3220
3625
  name: 'timeToConvert',
3221
- description: 'The time string that you want to convert',
3222
- type: 'string',
3626
+ description:
3627
+ 'The local time value to convert, as a date value or a parseable date string',
3628
+ type: 'string|date',
3223
3629
  },
3224
3630
  ],
3225
- returnType: 'string',
3226
- 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.',
3227
3634
  syntax: 'LocalDateToSystemDate(timeToConvert)',
3228
3635
  example: '%%=LocalDateToSystemDate(Now())=%%',
3636
+ isConfirmed: true,
3637
+ differsFromOfficialDocs: false,
3638
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/localdatetosystemdate/',
3229
3639
  },
3230
3640
  {
3231
3641
  name: 'LongSFID',
@@ -3248,7 +3658,8 @@ export const FUNCTIONS = [
3248
3658
  {
3249
3659
  name: 'Lookup',
3250
3660
  mcnSince: 67,
3251
- handlebarsEquivalent: null,
3661
+ handlebarsEquivalent: 'queryFirst',
3662
+ handlebarsExact: false,
3252
3663
  mcnNotes:
3253
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.',
3254
3665
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-data-extension/mc-ampscript-reference-data-extension-lookup.html',
@@ -3295,7 +3706,8 @@ export const FUNCTIONS = [
3295
3706
  {
3296
3707
  name: 'LookupOrderedRows',
3297
3708
  mcnSince: null,
3298
- handlebarsEquivalent: null,
3709
+ handlebarsEquivalent: 'query',
3710
+ handlebarsExact: false,
3299
3711
  mcnNotes: null,
3300
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',
3301
3713
  guideUrl: 'https://ampscript.guide/lookuporderedrows/',
@@ -3349,7 +3761,8 @@ export const FUNCTIONS = [
3349
3761
  {
3350
3762
  name: 'LookupOrderedRowsCS',
3351
3763
  mcnSince: null,
3352
- handlebarsEquivalent: null,
3764
+ handlebarsEquivalent: 'query',
3765
+ handlebarsExact: false,
3353
3766
  mcnNotes: null,
3354
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',
3355
3768
  guideUrl: 'https://ampscript.guide/lookuporderedrowscs/',
@@ -3402,7 +3815,8 @@ export const FUNCTIONS = [
3402
3815
  {
3403
3816
  name: 'LookupRows',
3404
3817
  mcnSince: null,
3405
- handlebarsEquivalent: null,
3818
+ handlebarsEquivalent: 'query',
3819
+ handlebarsExact: false,
3406
3820
  mcnNotes: null,
3407
3821
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-data-extension/mc-ampscript-reference-data-extension-lookup-rows.html',
3408
3822
  guideUrl: 'https://ampscript.guide/lookuprows/',
@@ -3441,7 +3855,8 @@ export const FUNCTIONS = [
3441
3855
  {
3442
3856
  name: 'LookupRowsCS',
3443
3857
  mcnSince: null,
3444
- handlebarsEquivalent: null,
3858
+ handlebarsEquivalent: 'query',
3859
+ handlebarsExact: false,
3445
3860
  mcnNotes: null,
3446
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',
3447
3862
  guideUrl: 'https://ampscript.guide/lookuprowscs/',
@@ -3481,9 +3896,11 @@ export const FUNCTIONS = [
3481
3896
  name: 'Lowercase',
3482
3897
  mcnSince: 67,
3483
3898
  handlebarsEquivalent: 'lowercase',
3899
+ handlebarsExact: true,
3484
3900
  mcnNotes: null,
3485
3901
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-string/mc-ampscript-reference-string-lowercase.html',
3486
3902
  guideUrl: 'https://ampscript.guide/lowercase/',
3903
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/lowercase/',
3487
3904
  minArgs: 1,
3488
3905
  maxArgs: 1,
3489
3906
  isConfirmed: true,
@@ -3509,27 +3926,37 @@ export const FUNCTIONS = [
3509
3926
  mcnNotes: null,
3510
3927
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-encryption/mc-ampscript-reference-encryption-md5.html',
3511
3928
  guideUrl: 'https://ampscript.guide/md5/',
3929
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/md5/',
3512
3930
  minArgs: 1,
3513
3931
  maxArgs: 2,
3514
3932
  category: 'Encryption and Encoding',
3515
- 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.',
3516
3935
  params: [
3517
- { 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
+ },
3518
3942
  {
3519
3943
  name: 'charSet',
3520
3944
  mcnSince: null,
3521
3945
  mcnNotes: null,
3522
- 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',
3523
3948
  type: 'string',
3524
- enum: ['UTF-8', 'UTF-16'],
3949
+ enum: ['UTF-8', 'UTF-16', 'UTF-16BE', 'UTF-32', 'ASCII', 'ISO-8859-1'],
3525
3950
  optional: true,
3526
3951
  default: 'UTF-8',
3527
3952
  },
3528
3953
  ],
3529
3954
  returnType: 'string',
3530
- returnDescription: 'The MD5 hash of the input as a hexadecimal string.',
3955
+ returnDescription: 'The MD5 hash of the input as 32 lowercase hexadecimal characters.',
3531
3956
  syntax: 'MD5(stringToConvert[, charSet])',
3532
3957
  example: '%%=MD5("This is a string of text.")=%%',
3958
+ isConfirmed: true,
3959
+ differsFromOfficialDocs: false,
3533
3960
  },
3534
3961
  {
3535
3962
  name: 'MMS_Content_URL',
@@ -3566,9 +3993,13 @@ export const FUNCTIONS = [
3566
3993
  minArgs: 1,
3567
3994
  maxArgs: INF,
3568
3995
  category: 'Utility',
3569
- 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/',
3570
4001
  params: [
3571
- { name: 'pageId', description: 'Microsite page ID', type: 'number' },
4002
+ { name: 'pageId', description: 'Microsite page ID', type: 'string|number' },
3572
4003
  {
3573
4004
  name: 'paramName1',
3574
4005
  description: 'Query parameter name',
@@ -3595,7 +4026,8 @@ export const FUNCTIONS = [
3595
4026
  },
3596
4027
  ],
3597
4028
  returnType: 'string',
3598
- 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.',
3599
4031
  repeat: [{ startIndex: 1, groupSize: 2, minGroups: 0 }],
3600
4032
  syntax: 'MicrositeURL(pageId[, paramName1, paramValue1, paramNameN, paramValueN, ...])',
3601
4033
  example: '%%=MicrositeURL(12345)=%%',
@@ -3604,9 +4036,11 @@ export const FUNCTIONS = [
3604
4036
  name: 'Mod',
3605
4037
  mcnSince: 67,
3606
4038
  handlebarsEquivalent: 'modulo',
4039
+ handlebarsExact: true,
3607
4040
  mcnNotes: null,
3608
4041
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-math/mc-ampscript-reference-math-mod.html',
3609
4042
  guideUrl: 'https://ampscript.guide/mod/',
4043
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/mod/',
3610
4044
  minArgs: 2,
3611
4045
  maxArgs: 2,
3612
4046
  category: 'Math',
@@ -3652,9 +4086,11 @@ export const FUNCTIONS = [
3652
4086
  name: 'Multiply',
3653
4087
  mcnSince: 67,
3654
4088
  handlebarsEquivalent: 'multiply',
4089
+ handlebarsExact: true,
3655
4090
  mcnNotes: null,
3656
4091
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-math/mc-ampscript-reference-math-multiply.html',
3657
4092
  guideUrl: 'https://ampscript.guide/multiply/',
4093
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/multiply/',
3658
4094
  minArgs: 2,
3659
4095
  maxArgs: 2,
3660
4096
  category: 'Math',
@@ -3717,26 +4153,32 @@ export const FUNCTIONS = [
3717
4153
  name: 'Now',
3718
4154
  mcnSince: 67,
3719
4155
  handlebarsEquivalent: 'now',
4156
+ handlebarsExact: false,
3720
4157
  mcnNotes: null,
3721
4158
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-date-time/mc-ampscript-reference-date-time-now.html',
3722
4159
  guideUrl: 'https://ampscript.guide/now/',
4160
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/now/',
3723
4161
  minArgs: 0,
3724
4162
  maxArgs: 1,
3725
4163
  category: 'Date and Time',
3726
4164
  description:
3727
- '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,
3728
4168
  params: [
3729
4169
  {
3730
4170
  name: 'persistFormat',
3731
4171
  mcnSince: null,
3732
4172
  mcnNotes: null,
3733
- description: 'Pass 1 to persist value',
3734
- 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',
3735
4176
  optional: true,
3736
4177
  },
3737
4178
  ],
3738
4179
  returnType: 'date',
3739
- 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.',
3740
4182
  syntax: 'Now([persistFormat])',
3741
4183
  example: '%%=Now()=%%',
3742
4184
  },
@@ -3747,16 +4189,28 @@ export const FUNCTIONS = [
3747
4189
  mcnNotes: null,
3748
4190
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-utilities/mc-ampscript-reference-utilities-output.html',
3749
4191
  guideUrl: 'https://ampscript.guide/output/',
3750
- minArgs: 1,
3751
- maxArgs: 1,
4192
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/output/',
4193
+ minArgs: 0,
4194
+ maxArgs: Infinity,
3752
4195
  category: 'Utility',
3753
4196
  description:
3754
- 'Writes a value to the rendered output. Used inside script blocks to emit content.',
3755
- 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
+ ],
3756
4205
  returnType: 'void',
3757
- 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.',
3758
4208
  syntax: 'Output(content)',
3759
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.',
3760
4214
  },
3761
4215
  {
3762
4216
  name: 'OutputLine',
@@ -3765,31 +4219,49 @@ export const FUNCTIONS = [
3765
4219
  mcnNotes: null,
3766
4220
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-utilities/mc-ampscript-reference-utilities-output-line.html',
3767
4221
  guideUrl: 'https://ampscript.guide/outputline/',
3768
- minArgs: 1,
3769
- maxArgs: 1,
4222
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/outputline/',
4223
+ minArgs: 0,
4224
+ maxArgs: Infinity,
3770
4225
  category: 'Utility',
3771
- description: 'Writes a value followed by a line break to the rendered output.',
3772
- 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
+ ],
3773
4235
  returnType: 'void',
3774
- 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.',
3775
4238
  syntax: 'OutputLine(content)',
3776
4239
  example: "%%=OutputLine(Concat('Hello ', @firstName))=%%",
4240
+ isConfirmed: true,
4241
+ differsFromOfficialDocs: false,
3777
4242
  },
3778
4243
  {
3779
4244
  name: 'ProperCase',
3780
4245
  mcnSince: 67,
3781
4246
  handlebarsEquivalent: 'properCase',
4247
+ handlebarsExact: true,
3782
4248
  mcnNotes: null,
3783
4249
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-string/mc-ampscript-reference-string-propercase.html',
3784
4250
  guideUrl: 'https://ampscript.guide/propercase/',
4251
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/propercase/',
3785
4252
  minArgs: 1,
3786
4253
  maxArgs: 1,
4254
+ isConfirmed: true,
4255
+ differsFromOfficialDocs: false,
3787
4256
  category: 'String',
3788
4257
  description:
3789
- 'Converts a string to proper (title) case, capitalizing the first letter of each word.',
3790
- 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
+ ],
3791
4262
  returnType: 'string',
3792
- 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.',
3793
4265
  syntax: 'ProperCase(sourceString)',
3794
4266
  example: "%%=ProperCase('hello world')=%%",
3795
4267
  },
@@ -3800,29 +4272,40 @@ export const FUNCTIONS = [
3800
4272
  mcnNotes: null,
3801
4273
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-sites/mc-ampscript-reference-sites-query-parameter.html',
3802
4274
  guideUrl: 'https://ampscript.guide/queryparameter/',
4275
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/queryparameter/',
3803
4276
  minArgs: 1,
3804
4277
  maxArgs: 1,
3805
4278
  category: 'Utility',
3806
4279
  description:
3807
- 'Returns the value of a URL query string parameter from the current page request.',
3808
- 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
+ ],
3809
4288
  returnType: 'string',
3810
- 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.',
3811
4291
  syntax: 'QueryParameter(parameterName)',
3812
4292
  example: "%%=QueryParameter('utm_source')=%%",
4293
+ isConfirmed: true,
3813
4294
  },
3814
4295
  {
3815
4296
  name: 'RaiseError',
3816
4297
  mcnSince: 67,
3817
4298
  handlebarsEquivalent: 'raiseError',
4299
+ handlebarsExact: false,
3818
4300
  mcnNotes: null,
3819
4301
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-utilities/mc-ampscript-reference-utilities-raise-error.html',
3820
4302
  guideUrl: 'https://ampscript.guide/raiseerror/',
4303
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/raiseerror/',
3821
4304
  minArgs: 1,
3822
4305
  maxArgs: 5,
3823
4306
  category: 'Utility',
3824
4307
  description:
3825
- '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.',
3826
4309
  params: [
3827
4310
  { name: 'message', description: 'Error message', type: 'string' },
3828
4311
  {
@@ -3831,7 +4314,7 @@ export const FUNCTIONS = [
3831
4314
  mcnNotes: null,
3832
4315
  description:
3833
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.',
3834
- type: 'boolean',
4317
+ type: 'string|boolean|number',
3835
4318
  optional: true,
3836
4319
  },
3837
4320
  {
@@ -3861,17 +4344,22 @@ export const FUNCTIONS = [
3861
4344
  },
3862
4345
  ],
3863
4346
  returnType: 'void',
3864
- 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.',
3865
4349
  syntax: 'RaiseError(message[, skipSubscriber, apiErrorCode, apiErrorNumber, preserveDataExt])',
3866
4350
  example: "RaiseError('Missing required field', 0)",
4351
+ isConfirmed: true,
4352
+ differsFromOfficialDocs: false,
3867
4353
  },
3868
4354
  {
3869
4355
  name: 'Random',
3870
4356
  mcnSince: 67,
3871
4357
  handlebarsEquivalent: 'random',
4358
+ handlebarsExact: true,
3872
4359
  mcnNotes: null,
3873
4360
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-utilities/mc-ampscript-reference-utilities-random.html',
3874
4361
  guideUrl: 'https://ampscript.guide/random/',
4362
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/random/',
3875
4363
  minArgs: 2,
3876
4364
  maxArgs: 2,
3877
4365
  category: 'Math',
@@ -3917,15 +4405,20 @@ export const FUNCTIONS = [
3917
4405
  mcnNotes: null,
3918
4406
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-sites/mc-ampscript-reference-sites-redirect.html',
3919
4407
  guideUrl: 'https://ampscript.guide/redirect/',
4408
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/redirect/',
3920
4409
  minArgs: 1,
3921
4410
  maxArgs: 1,
3922
4411
  category: 'Utility',
3923
- description: 'Performs an HTTP redirect to the specified URL. Landing pages only.',
3924
- 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' }],
3925
4415
  returnType: 'void',
3926
- 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.',
3927
4418
  syntax: 'Redirect(url)',
3928
4419
  example: "Redirect('https://example.com')",
4420
+ isConfirmed: true,
4421
+ differsFromOfficialDocs: false,
3929
4422
  },
3930
4423
  {
3931
4424
  name: 'RedirectTo',
@@ -3937,10 +4430,15 @@ export const FUNCTIONS = [
3937
4430
  minArgs: 1,
3938
4431
  maxArgs: 1,
3939
4432
  category: 'Utility',
3940
- description: 'Creates a trackable redirect URL, typically used in email links.',
3941
- 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' }],
3942
4439
  returnType: 'string',
3943
- 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.',
3944
4442
  syntax: 'RedirectTo(url)',
3945
4443
  example: '%%=RedirectTo(@targetUrl)=%%',
3946
4444
  },
@@ -3951,13 +4449,20 @@ export const FUNCTIONS = [
3951
4449
  mcnNotes: null,
3952
4450
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-string/mc-ampscript-reference-string-regex-match.html',
3953
4451
  guideUrl: 'https://ampscript.guide/regexmatch/',
4452
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/regexmatch/',
4453
+ isConfirmed: true,
4454
+ differsFromOfficialDocs: false,
3954
4455
  minArgs: 3,
3955
- maxArgs: 4,
4456
+ maxArgs: Infinity,
3956
4457
  category: 'String',
3957
4458
  description:
3958
- '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.',
3959
4460
  params: [
3960
- { name: 'sourceString', description: 'String to match against', type: 'string' },
4461
+ {
4462
+ name: 'sourceString',
4463
+ description: 'String to match against',
4464
+ type: 'string|number',
4465
+ },
3961
4466
  {
3962
4467
  name: 'regExPattern',
3963
4468
  description: 'The regular expression to use in the search',
@@ -3965,20 +4470,28 @@ export const FUNCTIONS = [
3965
4470
  },
3966
4471
  {
3967
4472
  name: 'returnValue',
3968
- description: 'The name or ordinal of the matching group to return',
3969
- type: 'string',
4473
+ description:
4474
+ 'Index or name of the capture group to return; 0 returns the whole match',
4475
+ type: 'string|number',
3970
4476
  },
3971
4477
  {
3972
4478
  name: 'regExOptions',
3973
4479
  description:
3974
- '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',
3975
4487
  type: 'string',
3976
4488
  optional: true,
3977
4489
  },
3978
4490
  ],
3979
4491
  returnType: 'string',
3980
- returnDescription: 'The matched text, or an empty string when there is no match.',
3981
- 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, ...])',
3982
4495
  example:
3983
4496
  'Var @couponCode, @regEx, @regExMatch\n' +
3984
4497
  'Set @couponCode = "SAVE23"\n' +
@@ -3989,21 +4502,32 @@ export const FUNCTIONS = [
3989
4502
  name: 'Replace',
3990
4503
  mcnSince: 67,
3991
4504
  handlebarsEquivalent: 'replace',
4505
+ handlebarsExact: false,
3992
4506
  mcnNotes: null,
3993
4507
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-string/mc-ampscript-reference-string-replace.html',
3994
4508
  guideUrl: 'https://ampscript.guide/replace/',
3995
- minArgs: 3,
4509
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/replace/',
4510
+ isConfirmed: true,
4511
+ differsFromOfficialDocs: false,
4512
+ minArgs: 2,
3996
4513
  maxArgs: 3,
3997
4514
  category: 'String',
3998
- 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.',
3999
4517
  params: [
4000
- { name: 'sourceString', description: 'Source string', type: 'string' },
4001
- { name: 'searchSubstring', description: 'Substring to find', type: 'string' },
4002
- { 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
+ },
4003
4526
  ],
4004
4527
  returnType: 'string',
4005
- returnDescription: 'The string with all occurrences of the search text replaced.',
4006
- 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])',
4007
4531
  example: "%%=Replace('Hello World', 'World', 'There')=%%",
4008
4532
  },
4009
4533
  {
@@ -4016,24 +4540,28 @@ export const FUNCTIONS = [
4016
4540
  minArgs: 3,
4017
4541
  maxArgs: INF,
4018
4542
  category: 'String',
4019
- 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.',
4020
4545
  params: [
4021
- { name: 'sourceString', description: 'Source string', type: 'string' },
4022
- { name: 'replacementString', description: 'Replacement string', type: 'string' },
4023
- { 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' },
4024
4549
  {
4025
4550
  name: 'searchStringN',
4026
4551
  description: 'Additional value to replace',
4027
- type: 'string',
4552
+ type: 'string|number',
4028
4553
  optional: true,
4029
4554
  },
4030
4555
  ],
4031
4556
  returnType: 'string',
4032
4557
  returnDescription:
4033
- '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.',
4034
4559
  repeat: [{ startIndex: 2, groupSize: 1, minGroups: 1 }],
4035
4560
  syntax: 'ReplaceList(sourceString, replacementString, searchString1[, searchStringN, ...])',
4036
4561
  example: "%%=ReplaceList('a-b/c', '_', '-', '/')=%%",
4562
+ isConfirmed: true,
4563
+ differsFromOfficialDocs: false,
4564
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/replacelist/',
4037
4565
  },
4038
4566
  {
4039
4567
  name: 'RequestParameter',
@@ -4042,16 +4570,25 @@ export const FUNCTIONS = [
4042
4570
  mcnNotes: null,
4043
4571
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-sites/mc-ampscript-reference-sites-request-parameter.html',
4044
4572
  guideUrl: 'https://ampscript.guide/requestparameter/',
4573
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/requestparameter/',
4045
4574
  minArgs: 1,
4046
4575
  maxArgs: 1,
4047
4576
  category: 'Utility',
4048
4577
  description:
4049
- 'Returns the value of a form post or query string parameter from the current request.',
4050
- 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
+ ],
4051
4586
  returnType: 'string',
4052
- 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.',
4053
4589
  syntax: 'RequestParameter(parameterName)',
4054
4590
  example: "%%=RequestParameter('id')=%%",
4591
+ isConfirmed: true,
4055
4592
  },
4056
4593
  {
4057
4594
  name: 'RetrieveMSCRMRecords',
@@ -4133,7 +4670,8 @@ export const FUNCTIONS = [
4133
4670
  {
4134
4671
  name: 'RetrieveSalesforceObjects',
4135
4672
  mcnSince: 67,
4136
- handlebarsEquivalent: null,
4673
+ handlebarsEquivalent: 'query',
4674
+ handlebarsExact: false,
4137
4675
  mcnNotes: null,
4138
4676
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-salesforce/mc-ampscript-reference-salesforce-retrieve-objects.html',
4139
4677
  guideUrl: 'https://ampscript.guide/retrievesalesforceobjects/',
@@ -4193,7 +4731,8 @@ export const FUNCTIONS = [
4193
4731
  {
4194
4732
  name: 'Row',
4195
4733
  mcnSince: 67,
4196
- handlebarsEquivalent: null,
4734
+ handlebarsEquivalent: 'get',
4735
+ handlebarsExact: false,
4197
4736
  mcnNotes: null,
4198
4737
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-data-extension/mc-ampscript-reference-data-extension-row.html',
4199
4738
  guideUrl: 'https://ampscript.guide/row/',
@@ -4213,7 +4752,8 @@ export const FUNCTIONS = [
4213
4752
  {
4214
4753
  name: 'RowCount',
4215
4754
  mcnSince: 67,
4216
- handlebarsEquivalent: null,
4755
+ handlebarsEquivalent: 'length',
4756
+ handlebarsExact: false,
4217
4757
  mcnNotes: null,
4218
4758
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-data-extension/mc-ampscript-reference-data-extension-row-count.html',
4219
4759
  guideUrl: 'https://ampscript.guide/rowcount/',
@@ -4323,27 +4863,37 @@ export const FUNCTIONS = [
4323
4863
  mcnNotes: null,
4324
4864
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-encryption/mc-ampscript-reference-encryption-sha1.html',
4325
4865
  guideUrl: 'https://ampscript.guide/sha1/',
4866
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/sha1/',
4326
4867
  minArgs: 1,
4327
4868
  maxArgs: 2,
4328
4869
  category: 'Encryption and Encoding',
4329
- 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.',
4330
4872
  params: [
4331
- { 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
+ },
4332
4879
  {
4333
4880
  name: 'charSet',
4334
4881
  mcnSince: null,
4335
4882
  mcnNotes: null,
4336
- 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',
4337
4885
  type: 'string',
4338
- enum: ['UTF-8', 'UTF-16'],
4886
+ enum: ['UTF-8', 'UTF-16', 'UTF-16BE', 'UTF-32', 'ASCII', 'ISO-8859-1'],
4339
4887
  optional: true,
4340
4888
  default: 'UTF-8',
4341
4889
  },
4342
4890
  ],
4343
4891
  returnType: 'string',
4344
- 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.',
4345
4893
  syntax: 'SHA1(stringToConvert[, charSet])',
4346
4894
  example: "%%=SHA1('This is a string of text.')=%%",
4895
+ isConfirmed: true,
4896
+ differsFromOfficialDocs: false,
4347
4897
  },
4348
4898
  {
4349
4899
  name: 'SHA256',
@@ -4352,27 +4902,37 @@ export const FUNCTIONS = [
4352
4902
  mcnNotes: null,
4353
4903
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-encryption/mc-ampscript-reference-encryption-sha256.html',
4354
4904
  guideUrl: 'https://ampscript.guide/sha256/',
4905
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/sha256/',
4355
4906
  minArgs: 1,
4356
4907
  maxArgs: 2,
4357
4908
  category: 'Encryption and Encoding',
4358
- 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.',
4359
4911
  params: [
4360
- { 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
+ },
4361
4918
  {
4362
4919
  name: 'charSet',
4363
4920
  mcnSince: null,
4364
4921
  mcnNotes: null,
4365
- 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',
4366
4924
  type: 'string',
4367
- enum: ['UTF-8', 'UTF-16'],
4925
+ enum: ['UTF-8', 'UTF-16', 'UTF-16BE', 'UTF-32', 'ASCII', 'ISO-8859-1'],
4368
4926
  optional: true,
4369
4927
  default: 'UTF-8',
4370
4928
  },
4371
4929
  ],
4372
4930
  returnType: 'string',
4373
- 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.',
4374
4932
  syntax: 'SHA256(stringToConvert[, charSet])',
4375
4933
  example: '%%=SHA256("This is a string of text.")=%%',
4934
+ isConfirmed: true,
4935
+ differsFromOfficialDocs: false,
4376
4936
  },
4377
4937
  {
4378
4938
  name: 'SHA512',
@@ -4381,27 +4941,37 @@ export const FUNCTIONS = [
4381
4941
  mcnNotes: null,
4382
4942
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-encryption/mc-ampscript-reference-encryption-sha512.html',
4383
4943
  guideUrl: 'https://ampscript.guide/sha512/',
4944
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/sha512/',
4384
4945
  minArgs: 1,
4385
4946
  maxArgs: 2,
4386
4947
  category: 'Encryption and Encoding',
4387
- 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.',
4388
4950
  params: [
4389
- { 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
+ },
4390
4957
  {
4391
4958
  name: 'charSet',
4392
4959
  mcnSince: null,
4393
4960
  mcnNotes: null,
4394
- 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',
4395
4963
  type: 'string',
4396
- enum: ['UTF-8', 'UTF-16'],
4964
+ enum: ['UTF-8', 'UTF-16', 'UTF-16BE', 'UTF-32', 'ASCII', 'ISO-8859-1'],
4397
4965
  optional: true,
4398
4966
  default: 'UTF-8',
4399
4967
  },
4400
4968
  ],
4401
4969
  returnType: 'string',
4402
- 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.',
4403
4971
  syntax: 'SHA512(stringToConvert[, charSet])',
4404
4972
  example: "%%=SHA512('This is a string of text.')=%%",
4973
+ isConfirmed: true,
4974
+ differsFromOfficialDocs: false,
4405
4975
  },
4406
4976
  {
4407
4977
  name: 'StringToDate',
@@ -4411,15 +4981,27 @@ export const FUNCTIONS = [
4411
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.',
4412
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',
4413
4983
  guideUrl: 'https://ampscript.guide/stringtodate/',
4984
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/stringtodate/',
4414
4985
  minArgs: 1,
4415
4986
  maxArgs: 1,
4416
4987
  category: 'Date and Time',
4417
- description: 'Converts a date string to a date value.',
4418
- 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
+ ],
4419
4998
  returnType: 'date',
4420
- 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.',
4421
5001
  syntax: 'StringToDate(dateString)',
4422
5002
  example: "%%=StringToDate('2026-01-15')=%%",
5003
+ isConfirmed: true,
5004
+ differsFromOfficialDocs: false,
4423
5005
  },
4424
5006
  {
4425
5007
  name: 'StringToHex',
@@ -4431,54 +5013,70 @@ export const FUNCTIONS = [
4431
5013
  minArgs: 1,
4432
5014
  maxArgs: 2,
4433
5015
  category: 'Encryption and Encoding',
4434
- 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.',
4435
5018
  params: [
4436
5019
  {
4437
5020
  name: 'sourceString',
4438
- 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',
4439
5023
  type: 'string',
4440
5024
  },
4441
5025
  {
4442
5026
  name: 'charSet',
4443
- 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',
4444
5029
  type: 'string',
4445
- enum: ['UTF-8', 'UTF-16'],
5030
+ enum: ['UTF-8', 'UTF-16', 'UTF-16BE', 'UTF-32', 'ASCII', 'ISO-8859-1'],
4446
5031
  optional: true,
4447
5032
  default: 'UTF-8',
4448
5033
  },
4449
5034
  ],
4450
5035
  returnType: 'string',
4451
- returnDescription: 'The hexadecimal representation of the input string.',
5036
+ returnDescription:
5037
+ 'The hexadecimal representation of the input string, in lowercase digits with no separators.',
4452
5038
  syntax: 'StringToHex(sourceString[, charSet])',
4453
5039
  example: "%%=StringToHex('AB')=%%",
5040
+ isConfirmed: true,
5041
+ differsFromOfficialDocs: false,
5042
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/stringtohex/',
4454
5043
  },
4455
5044
  {
4456
5045
  name: 'Substring',
4457
5046
  mcnSince: 67,
4458
5047
  handlebarsEquivalent: 'substring',
5048
+ handlebarsExact: true,
4459
5049
  mcnNotes: null,
4460
5050
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-string/mc-ampscript-reference-string-substring.html',
4461
5051
  guideUrl: 'https://ampscript.guide/substring/',
5052
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/substring/',
5053
+ isConfirmed: true,
5054
+ differsFromOfficialDocs: false,
4462
5055
  minArgs: 2,
4463
5056
  maxArgs: 3,
4464
5057
  category: 'String',
4465
5058
  description:
4466
- '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.',
4467
5060
  params: [
4468
- { name: 'sourceString', description: 'Source string', type: 'string' },
4469
- { 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
+ },
4470
5067
  {
4471
5068
  name: 'substringLength',
4472
5069
  mcnSince: 67,
4473
5070
  mcnNotes: null,
4474
5071
  description:
4475
- 'Number of characters to extract. If omitted, returns the remainder of the string.',
4476
- type: 'number',
5072
+ 'Number of characters to extract, as a whole number. If omitted, returns the remainder of the string.',
5073
+ type: 'string|number',
4477
5074
  optional: true,
4478
5075
  },
4479
5076
  ],
4480
5077
  returnType: 'string',
4481
- 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.',
4482
5080
  syntax: 'Substring(sourceString, startPosition[, substringLength])',
4483
5081
  example: "%%=Substring('Hello World', 1, 5)=%%",
4484
5082
  },
@@ -4486,9 +5084,11 @@ export const FUNCTIONS = [
4486
5084
  name: 'Subtract',
4487
5085
  mcnSince: 67,
4488
5086
  handlebarsEquivalent: 'subtract',
5087
+ handlebarsExact: true,
4489
5088
  mcnNotes: null,
4490
5089
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-math/mc-ampscript-reference-math-subtract.html',
4491
5090
  guideUrl: 'https://ampscript.guide/subtract/',
5091
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/subtract/',
4492
5092
  minArgs: 2,
4493
5093
  maxArgs: 2,
4494
5094
  category: 'Math',
@@ -4507,7 +5107,8 @@ export const FUNCTIONS = [
4507
5107
  {
4508
5108
  name: 'SystemDateToLocalDate',
4509
5109
  mcnSince: null,
4510
- handlebarsEquivalent: null,
5110
+ handlebarsEquivalent: 'timeZoneConversion',
5111
+ handlebarsExact: false,
4511
5112
  mcnNotes: null,
4512
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',
4513
5114
  guideUrl: 'https://ampscript.guide/systemdatetolocaldate/',
@@ -4515,16 +5116,21 @@ export const FUNCTIONS = [
4515
5116
  maxArgs: 1,
4516
5117
  category: 'Date and Time',
4517
5118
  description:
4518
- "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.',
4519
5120
  params: [
4520
5121
  {
4521
5122
  name: 'systemTime',
4522
- description: 'The system time value that you want to convert to local time',
4523
- type: 'string',
5123
+ description:
5124
+ 'The system time value to convert, as a date value or a parseable date string',
5125
+ type: 'string|date',
4524
5126
  },
4525
5127
  ],
4526
- returnType: 'string',
4527
- 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/',
4528
5134
  syntax: 'SystemDateToLocalDate(systemTime)',
4529
5135
  example: '%%=SystemDateToLocalDate(Now())=%%',
4530
5136
  },
@@ -4607,14 +5213,21 @@ export const FUNCTIONS = [
4607
5213
  name: 'Trim',
4608
5214
  mcnSince: 67,
4609
5215
  handlebarsEquivalent: 'trim',
5216
+ handlebarsExact: true,
4610
5217
  mcnNotes: null,
4611
5218
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-string/mc-ampscript-reference-string-trim.html',
4612
5219
  guideUrl: 'https://ampscript.guide/trim/',
5220
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/trim/',
4613
5221
  minArgs: 1,
4614
5222
  maxArgs: 1,
5223
+ isConfirmed: true,
5224
+ differsFromOfficialDocs: false,
4615
5225
  category: 'String',
4616
- description: 'Removes leading and trailing whitespace from a string.',
4617
- 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
+ ],
4618
5231
  returnType: 'string',
4619
5232
  returnDescription: 'The string with leading and trailing whitespace removed.',
4620
5233
  syntax: 'Trim(sourceString)',
@@ -4843,9 +5456,11 @@ export const FUNCTIONS = [
4843
5456
  name: 'Uppercase',
4844
5457
  mcnSince: 67,
4845
5458
  handlebarsEquivalent: 'uppercase',
5459
+ handlebarsExact: true,
4846
5460
  mcnNotes: null,
4847
5461
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-string/mc-ampscript-reference-string-uppercase.html',
4848
5462
  guideUrl: 'https://ampscript.guide/uppercase/',
5463
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/uppercase/',
4849
5464
  minArgs: 1,
4850
5465
  maxArgs: 1,
4851
5466
  isConfirmed: true,
@@ -5147,28 +5762,32 @@ export const FUNCTIONS = [
5147
5762
  minArgs: 1,
5148
5763
  maxArgs: 3,
5149
5764
  category: 'Encryption and Encoding',
5150
- 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/',
5151
5770
  params: [
5152
5771
  {
5153
5772
  name: 'urlToEncode',
5154
5773
  description: 'The string to convert to a format that is safe to include in URLs',
5155
- type: 'string',
5774
+ type: 'string|number',
5156
5775
  },
5157
5776
  {
5158
5777
  name: 'encodeAllChars',
5159
5778
  mcnSince: null,
5160
5779
  mcnNotes: null,
5161
5780
  description:
5162
- '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',
5163
- 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',
5164
5783
  optional: true,
5165
5784
  default: false,
5166
5785
  },
5167
5786
  {
5168
5787
  name: 'encodeAllStrings',
5169
5788
  description:
5170
- '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.',
5171
- 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',
5172
5791
  optional: true,
5173
5792
  },
5174
5793
  ],
@@ -5202,16 +5821,24 @@ export const FUNCTIONS = [
5202
5821
  mcnNotes: null,
5203
5822
  docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-utilities/mc-ampscript-reference-utilities-v.html',
5204
5823
  guideUrl: 'https://ampscript.guide/v/',
5824
+ sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/v/',
5205
5825
  minArgs: 1,
5206
5826
  maxArgs: 1,
5207
5827
  category: 'Utility',
5208
5828
  description:
5209
- 'Short alias for retrieving a variable value inline. Equivalent to %%=v(@var)=%%.',
5210
- 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
+ ],
5211
5837
  returnType: 'string',
5212
- returnDescription: 'The value of the referenced variable as a string.',
5838
+ returnDescription: 'The referenced value rendered as a string.',
5213
5839
  syntax: 'v(variableName)',
5214
5840
  example: '%%=v(@myVar)=%%',
5841
+ isConfirmed: true,
5215
5842
  },
5216
5843
  {
5217
5844
  name: 'WAT',
@@ -5249,6 +5876,9 @@ export const FUNCTIONS = [
5249
5876
  repeat: [{ startIndex: 1, groupSize: 1, minGroups: 1 }],
5250
5877
  syntax: 'WAT(parameterSetKey, parameterValue1[, parameterValueN, ...])',
5251
5878
  example: "%%=WAT('Omniture', '1234', '5678')=%%",
5879
+ isConfirmed: false,
5880
+ verificationBlocked: true,
5881
+ verificationBlockedReason: 'no-working-invocation',
5252
5882
  },
5253
5883
  {
5254
5884
  name: 'WATP',
@@ -5274,6 +5904,9 @@ export const FUNCTIONS = [
5274
5904
  'The parameter value supplied to the WAT function at the given ordinal position.',
5275
5905
  syntax: 'WATP(ordinal)',
5276
5906
  example: '%%=urlencode(WATP(1))=%%',
5907
+ isConfirmed: false,
5908
+ verificationBlocked: true,
5909
+ verificationBlockedReason: 'no-working-invocation',
5277
5910
  },
5278
5911
  {
5279
5912
  name: 'WrapLongURL',
@@ -5285,10 +5918,17 @@ export const FUNCTIONS = [
5285
5918
  minArgs: 1,
5286
5919
  maxArgs: 1,
5287
5920
  category: 'Utility',
5288
- description: 'Wraps a long URL to prevent line-break issues in email clients.',
5289
- 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' }],
5290
5929
  returnType: 'string',
5291
- 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.',
5292
5932
  syntax: 'WrapLongURL(url)',
5293
5933
  example: "%%=WrapLongURL('https://example.com/a/very/long/path')=%%",
5294
5934
  },
@@ -5398,47 +6038,186 @@ export const deprecatedFunctionLookup = new Map(
5398
6038
  * - `name` the keyword as written in source
5399
6039
  * - `description` short human-readable explanation
5400
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.
5401
6046
  *
5402
- * @type {{name: string, description: string, snippet: string}[]}
6047
+ * @type {{name: string, description: string, snippet: string, handlebarsEquivalent?: string | null, handlebarsNote?: string | null}[]}
5403
6048
  */
5404
6049
  export const AMPSCRIPT_KEYWORDS = [
5405
6050
  {
5406
6051
  name: 'var',
5407
6052
  description: 'Declares one or more variables',
5408
6053
  snippet: 'var @${1:variableName}',
6054
+ handlebarsEquivalent: 'set',
6055
+ handlebarsNote: 'Handlebars set is block-scoped and does not persist outside its block.',
5409
6056
  },
5410
6057
  {
5411
6058
  name: 'set',
5412
6059
  description: 'Assigns a value to a variable',
5413
6060
  snippet: 'set @${1:variableName} = ${2:value}',
6061
+ handlebarsEquivalent: 'set',
6062
+ handlebarsNote: 'Handlebars set is block-scoped and does not persist outside its block.',
5414
6063
  },
5415
6064
  {
5416
6065
  name: 'if',
5417
6066
  description: 'Begins a conditional block',
5418
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,
5419
6076
  },
5420
- { name: 'then', description: 'Follows an if/elseif condition', snippet: 'then' },
5421
6077
  {
5422
6078
  name: 'elseif',
5423
6079
  description: 'Additional condition in an if block',
5424
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,
5425
6096
  },
5426
- { name: 'else', description: 'Fallback branch in an if block', snippet: 'else' },
5427
- { name: 'endif', description: 'Closes an if block', snippet: 'endif' },
5428
6097
  {
5429
6098
  name: 'for',
5430
6099
  description: 'Begins a counting loop',
5431
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.',
5432
6220
  },
5433
- { name: 'to', description: 'Ascending direction in a for loop', snippet: 'to' },
5434
- { name: 'downto', description: 'Descending direction in a for loop', snippet: 'downto' },
5435
- { name: 'do', description: 'Marks the start of a loop body', snippet: 'do' },
5436
- { name: 'next', description: 'Ends a for loop iteration', snippet: 'next' },
5437
- { name: 'and', description: 'Logical AND operator', snippet: 'and' },
5438
- { name: 'or', description: 'Logical OR operator', snippet: 'or' },
5439
- { name: 'not', description: 'Logical NOT operator', snippet: 'not' },
5440
- { name: 'true', description: 'Boolean true constant', snippet: 'true' },
5441
- { name: 'false', description: 'Boolean false constant', snippet: 'false' },
5442
6221
  ];
5443
6222
 
5444
6223
  // ── Personalization strings ──────────────────────────────────────────────────