ampscript-data 3.7.0 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -0
- package/package.json +2 -2
- package/src/constants.js +63 -0
- package/src/derived.js +100 -0
- package/src/functions/content.js +1039 -0
- package/src/functions/data-extension.js +1118 -0
- package/src/functions/date-time.js +416 -0
- package/src/functions/einstein-email-recs.js +32 -0
- package/src/functions/encryption-encoding.js +550 -0
- package/src/functions/http.js +342 -0
- package/src/functions/index.js +203 -0
- package/src/functions/marketing-cloud-api.js +378 -0
- package/src/functions/math.js +167 -0
- package/src/functions/microsoft-dynamics.js +400 -0
- package/src/functions/mobileconnect.js +339 -0
- package/src/functions/sales-service-cloud.js +230 -0
- package/src/functions/social.js +151 -0
- package/src/functions/string.js +432 -0
- package/src/functions/utility.js +1120 -0
- package/src/globals.js +9 -0
- package/src/index.js +41 -7235
- package/src/keywords.js +121 -0
- package/src/operators.js +66 -0
- package/src/personalization.js +254 -0
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
// AUTO-SPLIT from the original single-file src/index.js. Data moved verbatim.
|
|
2
|
+
// AMPscript FUNCTIONS — category: Social (3 entries).
|
|
3
|
+
|
|
4
|
+
import { INF } from '../constants.js';
|
|
5
|
+
|
|
6
|
+
export const SOCIAL_FUNCTIONS = [
|
|
7
|
+
{
|
|
8
|
+
name: 'GetPublishedSocialContent',
|
|
9
|
+
supportedInCloudPage: false,
|
|
10
|
+
supportedInEmail: false,
|
|
11
|
+
mcnSince: null,
|
|
12
|
+
handlebarsEquivalent: null,
|
|
13
|
+
mcnNotes: null,
|
|
14
|
+
docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-social/mc-ampscript-reference-social-get-published-social-content.html',
|
|
15
|
+
guideUrl: 'https://ampscript.guide/getpublishedsocialcontent/',
|
|
16
|
+
minArgs: 1,
|
|
17
|
+
maxArgs: 1,
|
|
18
|
+
category: 'Social',
|
|
19
|
+
description: 'Retrieves published social media content by its identifier.',
|
|
20
|
+
params: [
|
|
21
|
+
{ name: 'socialContentId', description: 'Social content ID', type: 'string|number' },
|
|
22
|
+
],
|
|
23
|
+
returnType: 'string',
|
|
24
|
+
returnDescription: 'The published social content for the supplied identifier.',
|
|
25
|
+
syntax: 'GetPublishedSocialContent(socialContentId)',
|
|
26
|
+
example: "%%=GetPublishedSocialContent('socialContentId')=%%",
|
|
27
|
+
isConfirmed: true,
|
|
28
|
+
nonFunctionalAtRuntime: true,
|
|
29
|
+
differsFromOfficialDocs: true,
|
|
30
|
+
officialDocsNote:
|
|
31
|
+
'The community guide flags this as usable only inside Microsites and Landing Pages and only for content regions built in Classic Content, which is retired. A reached call aborts the page with HTTP 422 and no partial output for both a string region name and a numeric region id; gating the same call behind an unmatched query-string branch leaves the page at HTTP 200, confirming a runtime abort of the reached call rather than a compile-time failure. No Classic Content region exists to source a resolvable identifier, so the documented success path cannot be exercised. Email/send context: the send parser EXPLICITLY rejects this function with errorcode 10004 ("GetPublishedSocialContent Function is only allowed to be called from social sharing pages or landing pages") - a hard context restriction, stronger and different from the CloudPage runtime abort, which only occurs because no Classic Content region resolves.',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: 'GetSocialPublishURL',
|
|
35
|
+
supportedInCloudPage: true,
|
|
36
|
+
supportedInEmail: true,
|
|
37
|
+
mcnSince: null,
|
|
38
|
+
handlebarsEquivalent: null,
|
|
39
|
+
mcnNotes: null,
|
|
40
|
+
docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-social/mc-ampscript-reference-social-get-social-publish-url.html',
|
|
41
|
+
guideUrl: 'https://ampscript.guide/getsocialpublishurl/',
|
|
42
|
+
sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/getsocialpublishurl/',
|
|
43
|
+
minArgs: 2,
|
|
44
|
+
maxArgs: INF,
|
|
45
|
+
category: 'Social',
|
|
46
|
+
isConfirmed: true,
|
|
47
|
+
description:
|
|
48
|
+
'Returns HTML for sharing a content region on a supported social network via Social Forward. Optionally accepts repeating key/value parameter pairs.',
|
|
49
|
+
params: [
|
|
50
|
+
{
|
|
51
|
+
name: 'socialNetworkCode',
|
|
52
|
+
description: 'The number code of the social network to share to',
|
|
53
|
+
type: 'string|number',
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: 'contentRegion',
|
|
57
|
+
description: 'The name of the content region to share on the social network',
|
|
58
|
+
type: 'string',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: 'socialNetworkParamKey1',
|
|
62
|
+
description: 'The key of a parameter to pass to the target social network',
|
|
63
|
+
type: 'string',
|
|
64
|
+
optional: true,
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
name: 'socialNetworkParamValue1',
|
|
68
|
+
description: 'The value of a parameter to pass to the target social network',
|
|
69
|
+
type: 'string',
|
|
70
|
+
optional: true,
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
name: 'socialNetworkParamKeyN',
|
|
74
|
+
description: 'Additional parameter key',
|
|
75
|
+
type: 'string',
|
|
76
|
+
optional: true,
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
name: 'socialNetworkParamValueN',
|
|
80
|
+
description: 'Additional parameter value',
|
|
81
|
+
type: 'string',
|
|
82
|
+
optional: true,
|
|
83
|
+
},
|
|
84
|
+
],
|
|
85
|
+
returnType: 'string',
|
|
86
|
+
returnDescription: 'HTML that publishes the social-forward content for the region.',
|
|
87
|
+
repeat: [{ startIndex: 2, groupSize: 2, minGroups: 0 }],
|
|
88
|
+
syntax: 'GetSocialPublishURL(socialNetworkCode, contentRegion[, socialNetworkParamKey1, socialNetworkParamValue1, ...])',
|
|
89
|
+
example: "%%=GetSocialPublishURL(1, 'Shared content region 1')=%%",
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
name: 'GetSocialPublishURLByName',
|
|
93
|
+
supportedInCloudPage: true,
|
|
94
|
+
supportedInEmail: true,
|
|
95
|
+
mcnSince: null,
|
|
96
|
+
handlebarsEquivalent: null,
|
|
97
|
+
mcnNotes: null,
|
|
98
|
+
docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-social/mc-ampscript-reference-social-get-social-publish-url-by-name.html',
|
|
99
|
+
guideUrl: 'https://ampscript.guide/getsocialpublishurlbyname/',
|
|
100
|
+
sfmcGuideUrl:
|
|
101
|
+
'https://sfmc.guide/engagement/ampscript/functions/getsocialpublishurlbyname/',
|
|
102
|
+
minArgs: 3,
|
|
103
|
+
maxArgs: INF,
|
|
104
|
+
category: 'Social',
|
|
105
|
+
isConfirmed: true,
|
|
106
|
+
description:
|
|
107
|
+
'Returns HTML for sharing a content region on a supported social network (identified by name) via Social Forward. Optionally accepts repeating key/value parameter pairs.',
|
|
108
|
+
params: [
|
|
109
|
+
{
|
|
110
|
+
name: 'socialNetworkName',
|
|
111
|
+
description: 'The name of the social network to share to',
|
|
112
|
+
type: 'string',
|
|
113
|
+
},
|
|
114
|
+
{ name: 'countryCode', description: 'An ISO country code', type: 'string' },
|
|
115
|
+
{
|
|
116
|
+
name: 'contentRegion',
|
|
117
|
+
description: 'The name of the content region to share on the social network',
|
|
118
|
+
type: 'string',
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
name: 'socialNetworkParamKey1',
|
|
122
|
+
description: 'The key of a parameter to pass to the target social network',
|
|
123
|
+
type: 'string',
|
|
124
|
+
optional: true,
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
name: 'socialNetworkParamValue1',
|
|
128
|
+
description: 'The value of a parameter to pass to the target social network',
|
|
129
|
+
type: 'string',
|
|
130
|
+
optional: true,
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
name: 'socialNetworkParamKeyN',
|
|
134
|
+
description: 'Additional parameter key',
|
|
135
|
+
type: 'string',
|
|
136
|
+
optional: true,
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
name: 'socialNetworkParamValueN',
|
|
140
|
+
description: 'Additional parameter value',
|
|
141
|
+
type: 'string',
|
|
142
|
+
optional: true,
|
|
143
|
+
},
|
|
144
|
+
],
|
|
145
|
+
returnType: 'string',
|
|
146
|
+
returnDescription: 'HTML that publishes the social-forward content for the named region.',
|
|
147
|
+
repeat: [{ startIndex: 3, groupSize: 2, minGroups: 0 }],
|
|
148
|
+
syntax: 'GetSocialPublishURLByName(socialNetworkName, countryCode, contentRegion[, socialNetworkParamKey1, socialNetworkParamValue1, ...])',
|
|
149
|
+
example: "%%=GetSocialPublishURLByName('Facebook', 'US', 'Shared content region 1')=%%",
|
|
150
|
+
},
|
|
151
|
+
];
|
|
@@ -0,0 +1,432 @@
|
|
|
1
|
+
// AUTO-SPLIT from the original single-file src/index.js. Data moved verbatim.
|
|
2
|
+
// AMPscript FUNCTIONS — category: String (12 entries).
|
|
3
|
+
|
|
4
|
+
import { INF } from '../constants.js';
|
|
5
|
+
|
|
6
|
+
export const STRING_FUNCTIONS = [
|
|
7
|
+
{
|
|
8
|
+
name: 'Char',
|
|
9
|
+
supportedInCloudPage: true,
|
|
10
|
+
supportedInEmail: true,
|
|
11
|
+
mcnSince: null,
|
|
12
|
+
handlebarsEquivalent: 'char',
|
|
13
|
+
handlebarsExact: true,
|
|
14
|
+
mcnNotes: null,
|
|
15
|
+
docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-string/mc-ampscript-reference-string-char.html',
|
|
16
|
+
guideUrl: 'https://ampscript.guide/char/',
|
|
17
|
+
minArgs: 1,
|
|
18
|
+
maxArgs: 2,
|
|
19
|
+
category: 'String',
|
|
20
|
+
description:
|
|
21
|
+
'Returns the character for the given numeric character code. Codes above 255 are not rejected — they resolve to the matching Unicode character.',
|
|
22
|
+
params: [
|
|
23
|
+
{
|
|
24
|
+
name: 'characterCode',
|
|
25
|
+
description: 'Character code, as a whole number',
|
|
26
|
+
type: 'string|number',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: 'numRepetitions',
|
|
30
|
+
mcnSince: null,
|
|
31
|
+
mcnNotes: null,
|
|
32
|
+
description: 'Number of times to repeat the returned character, as a whole number',
|
|
33
|
+
type: 'string|number',
|
|
34
|
+
optional: true,
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
returnType: 'string',
|
|
38
|
+
returnDescription:
|
|
39
|
+
'The character for the supplied code, repeated when a repetition count is given. A count of 0 yields an empty string.',
|
|
40
|
+
syntax: 'Char(characterCode[, numRepetitions])',
|
|
41
|
+
example: '%%=Char(10)=%%',
|
|
42
|
+
isConfirmed: true,
|
|
43
|
+
differsFromOfficialDocs: false,
|
|
44
|
+
sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/char/',
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: 'Concat',
|
|
48
|
+
supportedInCloudPage: true,
|
|
49
|
+
supportedInEmail: true,
|
|
50
|
+
mcnSince: 67,
|
|
51
|
+
handlebarsEquivalent: 'concat',
|
|
52
|
+
handlebarsExact: true,
|
|
53
|
+
mcnNotes: null,
|
|
54
|
+
docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-string/mc-ampscript-reference-string-concat.html',
|
|
55
|
+
guideUrl: 'https://ampscript.guide/concat/',
|
|
56
|
+
sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/concat/',
|
|
57
|
+
minArgs: 1,
|
|
58
|
+
maxArgs: INF,
|
|
59
|
+
isConfirmed: true,
|
|
60
|
+
differsFromOfficialDocs: false,
|
|
61
|
+
category: 'String',
|
|
62
|
+
description: 'Concatenates two or more string values.',
|
|
63
|
+
params: [
|
|
64
|
+
{ name: 'string1', description: 'First string', type: 'string|number|date' },
|
|
65
|
+
{
|
|
66
|
+
name: 'string2',
|
|
67
|
+
description: 'Second string',
|
|
68
|
+
type: 'string|number|date',
|
|
69
|
+
optional: true,
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
name: 'stringN',
|
|
73
|
+
description: 'Additional string',
|
|
74
|
+
type: 'string|number|date',
|
|
75
|
+
optional: true,
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
returnType: 'string',
|
|
79
|
+
returnDescription: 'The concatenation of all supplied values as a single string.',
|
|
80
|
+
repeat: [{ startIndex: 0, groupSize: 1, minGroups: 1 }],
|
|
81
|
+
syntax: 'Concat(string1, string2[, stringN, ...])',
|
|
82
|
+
example: "%%=Concat('Hello', ' ', 'World')=%%",
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
name: 'IndexOf',
|
|
86
|
+
supportedInCloudPage: true,
|
|
87
|
+
supportedInEmail: true,
|
|
88
|
+
mcnSince: 67,
|
|
89
|
+
handlebarsEquivalent: 'indexOf',
|
|
90
|
+
handlebarsExact: false,
|
|
91
|
+
mcnNotes: null,
|
|
92
|
+
docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-string/mc-ampscript-reference-string-index-of.html',
|
|
93
|
+
guideUrl: 'https://ampscript.guide/indexof/',
|
|
94
|
+
sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/indexof/',
|
|
95
|
+
minArgs: 2,
|
|
96
|
+
maxArgs: 3,
|
|
97
|
+
category: 'String',
|
|
98
|
+
description:
|
|
99
|
+
'Returns the 1-based position of a substring, matching case-insensitively. An undocumented third argument selects which occurrence to locate.',
|
|
100
|
+
params: [
|
|
101
|
+
{
|
|
102
|
+
name: 'sourceString',
|
|
103
|
+
description: 'String to search in',
|
|
104
|
+
type: 'string|number',
|
|
105
|
+
},
|
|
106
|
+
{ name: 'substring', description: 'Substring to find', type: 'string|number' },
|
|
107
|
+
{
|
|
108
|
+
name: 'occurrence',
|
|
109
|
+
description: 'Which occurrence to locate, as a whole number; defaults to the first',
|
|
110
|
+
type: 'string|number',
|
|
111
|
+
},
|
|
112
|
+
],
|
|
113
|
+
returnType: 'number',
|
|
114
|
+
returnDescription:
|
|
115
|
+
'The 1-based position of the substring, or 0 when it is not found or the requested occurrence does not exist.',
|
|
116
|
+
syntax: 'IndexOf(sourceString, substring[, occurrence])',
|
|
117
|
+
example: "%%=IndexOf('Hello World', 'World')=%%",
|
|
118
|
+
isConfirmed: true,
|
|
119
|
+
differsFromOfficialDocs: false,
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
name: 'Length',
|
|
123
|
+
supportedInCloudPage: true,
|
|
124
|
+
supportedInEmail: true,
|
|
125
|
+
mcnSince: 67,
|
|
126
|
+
handlebarsEquivalent: 'length',
|
|
127
|
+
handlebarsExact: true,
|
|
128
|
+
mcnNotes: null,
|
|
129
|
+
docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-string/mc-ampscript-reference-string-length.html',
|
|
130
|
+
guideUrl: 'https://ampscript.guide/length/',
|
|
131
|
+
sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/length/',
|
|
132
|
+
minArgs: 1,
|
|
133
|
+
maxArgs: 1,
|
|
134
|
+
isConfirmed: true,
|
|
135
|
+
differsFromOfficialDocs: false,
|
|
136
|
+
category: 'String',
|
|
137
|
+
description: 'Returns the number of characters in a string.',
|
|
138
|
+
params: [
|
|
139
|
+
{
|
|
140
|
+
name: 'sourceString',
|
|
141
|
+
description: 'String to measure',
|
|
142
|
+
type: 'string|number|date',
|
|
143
|
+
},
|
|
144
|
+
],
|
|
145
|
+
returnType: 'number',
|
|
146
|
+
returnDescription:
|
|
147
|
+
'The number of UTF-16 code units in the string, so characters outside the Basic Multilingual Plane (such as emoji) count as 2.',
|
|
148
|
+
syntax: 'Length(sourceString)',
|
|
149
|
+
example: "%%=Length('Hello')=%%",
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
name: 'Lowercase',
|
|
153
|
+
supportedInCloudPage: true,
|
|
154
|
+
supportedInEmail: true,
|
|
155
|
+
mcnSince: 67,
|
|
156
|
+
handlebarsEquivalent: 'lowercase',
|
|
157
|
+
handlebarsExact: true,
|
|
158
|
+
mcnNotes: null,
|
|
159
|
+
docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-string/mc-ampscript-reference-string-lowercase.html',
|
|
160
|
+
guideUrl: 'https://ampscript.guide/lowercase/',
|
|
161
|
+
sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/lowercase/',
|
|
162
|
+
minArgs: 1,
|
|
163
|
+
maxArgs: 1,
|
|
164
|
+
isConfirmed: true,
|
|
165
|
+
differsFromOfficialDocs: false,
|
|
166
|
+
category: 'String',
|
|
167
|
+
description: 'Converts a string to all lowercase characters.',
|
|
168
|
+
params: [
|
|
169
|
+
{
|
|
170
|
+
name: 'sourceString',
|
|
171
|
+
description: 'String to convert',
|
|
172
|
+
type: 'string|number|date',
|
|
173
|
+
},
|
|
174
|
+
],
|
|
175
|
+
returnType: 'string',
|
|
176
|
+
returnDescription: 'The string converted to lower case.',
|
|
177
|
+
syntax: 'Lowercase(sourceString)',
|
|
178
|
+
example: "%%=Lowercase('HELLO')=%%",
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
name: 'ProperCase',
|
|
182
|
+
supportedInCloudPage: true,
|
|
183
|
+
supportedInEmail: true,
|
|
184
|
+
mcnSince: 67,
|
|
185
|
+
handlebarsEquivalent: 'properCase',
|
|
186
|
+
handlebarsExact: true,
|
|
187
|
+
mcnNotes: null,
|
|
188
|
+
docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-string/mc-ampscript-reference-string-propercase.html',
|
|
189
|
+
guideUrl: 'https://ampscript.guide/propercase/',
|
|
190
|
+
sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/propercase/',
|
|
191
|
+
minArgs: 1,
|
|
192
|
+
maxArgs: 1,
|
|
193
|
+
isConfirmed: true,
|
|
194
|
+
differsFromOfficialDocs: false,
|
|
195
|
+
category: 'String',
|
|
196
|
+
description:
|
|
197
|
+
'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.',
|
|
198
|
+
params: [
|
|
199
|
+
{ name: 'sourceString', description: 'Value to convert', type: 'string|number|date' },
|
|
200
|
+
],
|
|
201
|
+
returnType: 'string',
|
|
202
|
+
returnDescription:
|
|
203
|
+
'The value with the first letter of each word capitalized and the rest lower-cased.',
|
|
204
|
+
syntax: 'ProperCase(sourceString)',
|
|
205
|
+
example: "%%=ProperCase('hello world')=%%",
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
name: 'RegExMatch',
|
|
209
|
+
supportedInCloudPage: true,
|
|
210
|
+
supportedInEmail: true,
|
|
211
|
+
mcnSince: null,
|
|
212
|
+
handlebarsEquivalent: null,
|
|
213
|
+
mcnNotes: null,
|
|
214
|
+
docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-string/mc-ampscript-reference-string-regex-match.html',
|
|
215
|
+
guideUrl: 'https://ampscript.guide/regexmatch/',
|
|
216
|
+
sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/regexmatch/',
|
|
217
|
+
isConfirmed: true,
|
|
218
|
+
differsFromOfficialDocs: false,
|
|
219
|
+
minArgs: 3,
|
|
220
|
+
maxArgs: INF,
|
|
221
|
+
category: 'String',
|
|
222
|
+
description:
|
|
223
|
+
'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.',
|
|
224
|
+
params: [
|
|
225
|
+
{
|
|
226
|
+
name: 'sourceString',
|
|
227
|
+
description: 'String to match against',
|
|
228
|
+
type: 'string|number',
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
name: 'regExPattern',
|
|
232
|
+
description: 'The regular expression to use in the search',
|
|
233
|
+
type: 'string',
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
name: 'returnValue',
|
|
237
|
+
description:
|
|
238
|
+
'Index or name of the capture group to return; 0 returns the whole match',
|
|
239
|
+
type: 'string|number',
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
name: 'regExOptions',
|
|
243
|
+
description:
|
|
244
|
+
'A .NET RegexOptions member name to apply to the search, such as IgnoreCase or Multiline',
|
|
245
|
+
type: 'string',
|
|
246
|
+
optional: true,
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
name: 'regExOptionsN',
|
|
250
|
+
description: 'Additional RegexOptions member name',
|
|
251
|
+
type: 'string',
|
|
252
|
+
optional: true,
|
|
253
|
+
},
|
|
254
|
+
],
|
|
255
|
+
returnType: 'string',
|
|
256
|
+
returnDescription:
|
|
257
|
+
'The text of the selected capture group, or an empty string when the pattern does not match or the group does not exist.',
|
|
258
|
+
repeat: [{ startIndex: 3, groupSize: 1, minGroups: 0 }],
|
|
259
|
+
syntax: 'RegExMatch(sourceString, regExPattern, returnValue[, regExOptions, ...])',
|
|
260
|
+
example:
|
|
261
|
+
'Var @couponCode, @regEx, @regExMatch\n' +
|
|
262
|
+
'Set @couponCode = "SAVE23"\n' +
|
|
263
|
+
'Set @regEx = "^[A-Z0-9]{5,7}$"\n' +
|
|
264
|
+
'Set @regExMatch = RegExMatch(@couponCode, @regEx, 0, "IgnoreCase")',
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
name: 'Replace',
|
|
268
|
+
supportedInCloudPage: true,
|
|
269
|
+
supportedInEmail: true,
|
|
270
|
+
mcnSince: 67,
|
|
271
|
+
handlebarsEquivalent: 'replace',
|
|
272
|
+
handlebarsExact: false,
|
|
273
|
+
mcnNotes: null,
|
|
274
|
+
docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-string/mc-ampscript-reference-string-replace.html',
|
|
275
|
+
guideUrl: 'https://ampscript.guide/replace/',
|
|
276
|
+
sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/replace/',
|
|
277
|
+
isConfirmed: true,
|
|
278
|
+
differsFromOfficialDocs: false,
|
|
279
|
+
minArgs: 2,
|
|
280
|
+
maxArgs: 3,
|
|
281
|
+
category: 'String',
|
|
282
|
+
description:
|
|
283
|
+
'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.',
|
|
284
|
+
params: [
|
|
285
|
+
{ name: 'sourceString', description: 'Source string', type: 'string|number' },
|
|
286
|
+
{ name: 'searchSubstring', description: 'Substring to find', type: 'string|number' },
|
|
287
|
+
{
|
|
288
|
+
name: 'replacementSubstring',
|
|
289
|
+
description: 'Replacement string. If omitted, the search text is removed.',
|
|
290
|
+
type: 'string|number',
|
|
291
|
+
optional: true,
|
|
292
|
+
},
|
|
293
|
+
],
|
|
294
|
+
returnType: 'string',
|
|
295
|
+
returnDescription:
|
|
296
|
+
'The string with every occurrence of the search text replaced, or the source unchanged when the search text is not found.',
|
|
297
|
+
syntax: 'Replace(sourceString, searchSubstring[, replacementSubstring])',
|
|
298
|
+
example: "%%=Replace('Hello World', 'World', 'There')=%%",
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
name: 'ReplaceList',
|
|
302
|
+
supportedInCloudPage: true,
|
|
303
|
+
supportedInEmail: true,
|
|
304
|
+
mcnSince: 67,
|
|
305
|
+
handlebarsEquivalent: null,
|
|
306
|
+
mcnNotes: null,
|
|
307
|
+
docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-string/mc-ampscript-reference-string-replace-list.html',
|
|
308
|
+
guideUrl: 'https://ampscript.guide/replacelist/',
|
|
309
|
+
minArgs: 3,
|
|
310
|
+
maxArgs: INF,
|
|
311
|
+
category: 'String',
|
|
312
|
+
description:
|
|
313
|
+
'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.',
|
|
314
|
+
params: [
|
|
315
|
+
{ name: 'sourceString', description: 'Source string', type: 'string|number' },
|
|
316
|
+
{ name: 'replacementString', description: 'Replacement string', type: 'string|number' },
|
|
317
|
+
{ name: 'searchString1', description: 'First value to replace', type: 'string|number' },
|
|
318
|
+
{
|
|
319
|
+
name: 'searchStringN',
|
|
320
|
+
description: 'Additional value to replace',
|
|
321
|
+
type: 'string|number',
|
|
322
|
+
optional: true,
|
|
323
|
+
},
|
|
324
|
+
],
|
|
325
|
+
returnType: 'string',
|
|
326
|
+
returnDescription:
|
|
327
|
+
'The string with every supplied search value replaced by the replacement, or the source unchanged when none of them is found.',
|
|
328
|
+
repeat: [{ startIndex: 2, groupSize: 1, minGroups: 1 }],
|
|
329
|
+
syntax: 'ReplaceList(sourceString, replacementString, searchString1[, searchStringN, ...])',
|
|
330
|
+
example: "%%=ReplaceList('a-b/c', '_', '-', '/')=%%",
|
|
331
|
+
isConfirmed: true,
|
|
332
|
+
differsFromOfficialDocs: false,
|
|
333
|
+
sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/replacelist/',
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
name: 'Substring',
|
|
337
|
+
supportedInCloudPage: true,
|
|
338
|
+
supportedInEmail: true,
|
|
339
|
+
mcnSince: 67,
|
|
340
|
+
handlebarsEquivalent: 'substring',
|
|
341
|
+
handlebarsExact: true,
|
|
342
|
+
mcnNotes: null,
|
|
343
|
+
docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-string/mc-ampscript-reference-string-substring.html',
|
|
344
|
+
guideUrl: 'https://ampscript.guide/substring/',
|
|
345
|
+
sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/substring/',
|
|
346
|
+
isConfirmed: true,
|
|
347
|
+
differsFromOfficialDocs: false,
|
|
348
|
+
minArgs: 2,
|
|
349
|
+
maxArgs: 3,
|
|
350
|
+
category: 'String',
|
|
351
|
+
description:
|
|
352
|
+
'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.',
|
|
353
|
+
params: [
|
|
354
|
+
{ name: 'sourceString', description: 'Source string', type: 'string|number' },
|
|
355
|
+
{
|
|
356
|
+
name: 'startPosition',
|
|
357
|
+
description: '1-based start position, as a whole number',
|
|
358
|
+
type: 'string|number',
|
|
359
|
+
},
|
|
360
|
+
{
|
|
361
|
+
name: 'substringLength',
|
|
362
|
+
mcnSince: 67,
|
|
363
|
+
mcnNotes: null,
|
|
364
|
+
description:
|
|
365
|
+
'Number of characters to extract, as a whole number. If omitted, returns the remainder of the string.',
|
|
366
|
+
type: 'string|number',
|
|
367
|
+
optional: true,
|
|
368
|
+
},
|
|
369
|
+
],
|
|
370
|
+
returnType: 'string',
|
|
371
|
+
returnDescription:
|
|
372
|
+
'The requested portion of the string, or an empty string when the start position is past the end of the source.',
|
|
373
|
+
syntax: 'Substring(sourceString, startPosition[, substringLength])',
|
|
374
|
+
example: "%%=Substring('Hello World', 1, 5)=%%",
|
|
375
|
+
},
|
|
376
|
+
{
|
|
377
|
+
name: 'Trim',
|
|
378
|
+
supportedInCloudPage: true,
|
|
379
|
+
supportedInEmail: true,
|
|
380
|
+
mcnSince: 67,
|
|
381
|
+
handlebarsEquivalent: 'trim',
|
|
382
|
+
handlebarsExact: true,
|
|
383
|
+
mcnNotes: null,
|
|
384
|
+
docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-string/mc-ampscript-reference-string-trim.html',
|
|
385
|
+
guideUrl: 'https://ampscript.guide/trim/',
|
|
386
|
+
sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/trim/',
|
|
387
|
+
minArgs: 1,
|
|
388
|
+
maxArgs: 1,
|
|
389
|
+
isConfirmed: true,
|
|
390
|
+
differsFromOfficialDocs: false,
|
|
391
|
+
category: 'String',
|
|
392
|
+
description:
|
|
393
|
+
'Removes leading and trailing whitespace from a value. Tabs, line breaks and the non-breaking space count as whitespace.',
|
|
394
|
+
params: [
|
|
395
|
+
{ name: 'sourceString', description: 'Value to trim', type: 'string|number|date' },
|
|
396
|
+
],
|
|
397
|
+
returnType: 'string',
|
|
398
|
+
returnDescription: 'The string with leading and trailing whitespace removed.',
|
|
399
|
+
syntax: 'Trim(sourceString)',
|
|
400
|
+
example: "%%=Trim(' hello ')=%%",
|
|
401
|
+
},
|
|
402
|
+
{
|
|
403
|
+
name: 'Uppercase',
|
|
404
|
+
supportedInCloudPage: true,
|
|
405
|
+
supportedInEmail: true,
|
|
406
|
+
mcnSince: 67,
|
|
407
|
+
handlebarsEquivalent: 'uppercase',
|
|
408
|
+
handlebarsExact: true,
|
|
409
|
+
mcnNotes: null,
|
|
410
|
+
docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-string/mc-ampscript-reference-string-uppercase.html',
|
|
411
|
+
guideUrl: 'https://ampscript.guide/uppercase/',
|
|
412
|
+
sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/uppercase/',
|
|
413
|
+
minArgs: 1,
|
|
414
|
+
maxArgs: 1,
|
|
415
|
+
isConfirmed: true,
|
|
416
|
+
differsFromOfficialDocs: false,
|
|
417
|
+
category: 'String',
|
|
418
|
+
description:
|
|
419
|
+
'Converts a string to all uppercase characters. The German sharp s remains unchanged rather than expanding to SS.',
|
|
420
|
+
params: [
|
|
421
|
+
{
|
|
422
|
+
name: 'sourceString',
|
|
423
|
+
description: 'String to convert',
|
|
424
|
+
type: 'string|number|date',
|
|
425
|
+
},
|
|
426
|
+
],
|
|
427
|
+
returnType: 'string',
|
|
428
|
+
returnDescription: 'The string converted to upper case.',
|
|
429
|
+
syntax: 'Uppercase(sourceString)',
|
|
430
|
+
example: "%%=Uppercase('hello')=%%",
|
|
431
|
+
},
|
|
432
|
+
];
|