You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/active-directory/manage-apps/functions-for-customizing-application-data.md
+318-1Lines changed: 318 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,7 +34,7 @@ The syntax for Expressions for Attribute Mappings is reminiscent of Visual Basic
34
34
* For string constants, if you need a backslash ( \ ) or quotation mark ( " ) in the string, it must be escaped with the backslash ( \ ) symbol. For example: "Company name: \\"Contoso\\""
@@ -51,6 +51,48 @@ Takes a source string value and appends the suffix to the end of it.
51
51
|**source**|Required |String |Usually name of the attribute from the source object. |
52
52
|**suffix**|Required |String |The string that you want to append to the end of the source value. |
53
53
54
+
---
55
+
### BitAnd
56
+
**Function:**<br>
57
+
BitAnd(value1, value2)
58
+
59
+
**Description:**<br>
60
+
This function converts both parameters to the binary representation and sets a bit to:
61
+
62
+
0 - if one or both of the corresponding bits in value1 and value2 are 0
63
+
1 - if both of the corresponding bits are 1.
64
+
65
+
In other words, it returns 0 in all cases except when the corresponding bits of both parameters are 1.
66
+
67
+
**Parameters:**<br>
68
+
69
+
| Name | Required/ Repeating | Type | Notes |
70
+
| --- | --- | --- | --- |
71
+
|**value1**|Required |num |Numeric value that should be AND’ed with value2|
72
+
|**value2**|Required |num |Numeric value that should be AND’ed with value1|
73
+
74
+
**Example:**<br>
75
+
BitAnd(&HF, &HF7)
76
+
11110111 AND 00000111 = 00000111 so BitAnd returns 7, the binary value of 00000111
77
+
78
+
---
79
+
### CBool
80
+
**Function:**<br>
81
+
CBool(Expression)
82
+
83
+
**Description:**<br>
84
+
CBool returns a boolean based on the evaluated expression. If the expression evaluates to a non-zero value, then CBool returns True, else it returns False..
85
+
86
+
**Parameters:**<br>
87
+
88
+
| Name | Required/ Repeating | Type | Notes |
89
+
| --- | --- | --- | --- |
90
+
|**expression**|Required | expression | Any valid expression |
91
+
92
+
**Example:**<br>
93
+
CBool([attribute1] = [attribute2])
94
+
Returns True if both attributes have the same value.
95
+
54
96
---
55
97
### Coalesce
56
98
**Function:**<br>
@@ -66,6 +108,93 @@ Returns the first source value that is not NULL. If all arguments are NULL and d
66
108
|**source1 … sourceN**| Required | String |Required, variable-number of times. Usually name of the attribute from the source object. |
67
109
| **defaultValue** | Optional | String | Default value to be used when all source values are NULL. Can be empty string ("").
68
110
111
+
---
112
+
### ConvertToBase64
113
+
**Function:**<br>
114
+
ConvertToBase64(source)
115
+
116
+
**Description:**<br>
117
+
The ConvertToBase64 function converts a string to a Unicode base64 string.
118
+
119
+
**Parameters:**<br>
120
+
121
+
| Name | Required/ Repeating | Type | Notes |
122
+
| --- | --- | --- | --- |
123
+
|**source**|Required |String |String to be converted to base 64|
124
+
125
+
**Example:**<br>
126
+
ConvertToBase64("Hello world!")
127
+
Returns "SABlAGwAbABvACAAdwBvAHIAbABkACEA"
128
+
129
+
---
130
+
### ConvertToUTF8Hex
131
+
**Function:**<br>
132
+
ConvertToUTF8Hex(source)
133
+
134
+
**Description:**<br>
135
+
The ConvertToUTF8Hex function converts a string to a UTF8 Hex encoded value.
136
+
137
+
**Parameters:**<br>
138
+
139
+
| Name | Required/ Repeating | Type | Notes |
140
+
| --- | --- | --- | --- |
141
+
|**source**|Required |String |String to be converted to UTF8 Hex|
142
+
143
+
**Example:**<br>
144
+
ConvertToUTF8Hex("Hello world!")
145
+
Returns 48656C6C6F20776F726C6421
146
+
147
+
---
148
+
### Count
149
+
**Function:**<br>
150
+
Count(attribute)
151
+
152
+
**Description:**<br>
153
+
The Count function returns the number of elements in a multi-valued attribute
154
+
155
+
**Parameters:**<br>
156
+
157
+
| Name | Required/ Repeating | Type | Notes |
158
+
| --- | --- | --- | --- |
159
+
|**attribute**|Required |attribute |Multi-valued attribute that will have elements counted|
160
+
161
+
---
162
+
### CStr
163
+
**Function:**<br>
164
+
CStr(value)
165
+
166
+
**Description:**<br>
167
+
The CStr function converts a value to a string data type.
168
+
169
+
**Parameters:**<br>
170
+
171
+
| Name | Required/ Repeating | Type | Notes |
172
+
| --- | --- | --- | --- |
173
+
|**value**|Required | numeric, reference or boolean | Can be a numeric value, reference attribute, or Boolean. |
174
+
175
+
**Example:**<br>
176
+
CStr([dn])
177
+
Returns "cn=Joe,dc=contoso,dc=com"
178
+
179
+
---
180
+
### DateFromNum
181
+
**Function:**<br>
182
+
DateFromNum(value)
183
+
184
+
**Description:**<br>
185
+
The DateFromNum function converts a value in AD’s date format to a DateTime type.
186
+
187
+
**Parameters:**<br>
188
+
189
+
| Name | Required/ Repeating | Type | Notes |
190
+
| --- | --- | --- | --- |
191
+
|**value**|Required | Date | AD Date to be converted to DateTime type |
192
+
193
+
**Example:**<br>
194
+
DateFromNum([lastLogonTimestamp])
195
+
DateFromNum(129699324000000000)
196
+
Returns a DateTime representing 2012-01-01 23:00:00
197
+
69
198
---
70
199
### FormatDateTime
71
200
**Function:**<br>
@@ -82,6 +211,124 @@ Takes a date string from one format and converts it into a different format.
82
211
|**inputFormat**|Required |String |Expected format of the source value. For supported formats, see [https://msdn.microsoft.com/library/8kb3ddd4%28v=vs.110%29.aspx](https://msdn.microsoft.com/library/8kb3ddd4%28v=vs.110%29.aspx). |
83
212
|**outputFormat**|Required |String |Format of the output date. |
84
213
214
+
---
215
+
### Guid
216
+
**Function:**<br>
217
+
Guid()
218
+
219
+
**Description:**<br>
220
+
The function Guid generates a new random GUID
221
+
222
+
---
223
+
### InStr
224
+
**Function:**<br>
225
+
InStr(value1,value2,start,compareType)
226
+
227
+
**Description:**<br>
228
+
The InStr function finds the first occurrence of a substring in a string
229
+
230
+
**Parameters:**<br>
231
+
232
+
| Name | Required/ Repeating | Type | Notes |
233
+
| --- | --- | --- | --- |
234
+
|**value1**|Required |String |String to be searched |
235
+
|**value2**|Required |String |String to be found |
236
+
|**start**|Optional |Integer |Starting position to find the substring|
237
+
|**compareType**|Optional |Enum |Can be vbTextCompare or vbBinaryCompare |
238
+
239
+
**Example:**<br>
240
+
InStr("The quick brown fox","quick")
241
+
Evalues to 5
242
+
243
+
InStr("repEated","e",3,vbBinaryCompare)
244
+
Evaluates to 7
245
+
246
+
---
247
+
### IsNull
248
+
**Function:**<br>
249
+
IsNull(Expression)
250
+
251
+
**Description:**<br>
252
+
If the expression evaluates to Null, then the IsNull function returns true. For an attribute, a Null is expressed by the absence of the attribute.
253
+
254
+
**Parameters:**<br>
255
+
256
+
| Name | Required/ Repeating | Type | Notes |
257
+
| --- | --- | --- | --- |
258
+
|**expression**|Required |expression |Expression to be evaluated |
259
+
260
+
**Example:**<br>
261
+
IsNull([displayName])
262
+
Returns True if the attribute is not present
263
+
264
+
---
265
+
### IsNullorEmpty
266
+
**Function:**<br>
267
+
IsNullOrEmpty(Expression)
268
+
269
+
**Description:**<br>
270
+
If the expression is null or an empty string, then the IsNullOrEmpty function returns true. For an attribute, this would evaluate to True if the attribute is absent or is present but is an empty string.
271
+
The inverse of this function is named IsPresent.
272
+
273
+
**Parameters:**<br>
274
+
275
+
| Name | Required/ Repeating | Type | Notes |
276
+
| --- | --- | --- | --- |
277
+
|**expression**|Required |expression |Expression to be evaluated |
278
+
279
+
**Example:**<br>
280
+
IsNullOrEmpty([displayName])
281
+
Returns True if the attribute is not present or is an empty string
282
+
283
+
---
284
+
### IsPresent
285
+
**Function:**<br>
286
+
IsNullOrEmpty(Expression)
287
+
288
+
**Description:**<br>
289
+
If the expression evaluates to a string that is not Null and is not empty, then the IsPresent function returns true. The inverse of this function is named IsNullOrEmpty.
290
+
291
+
**Parameters:**<br>
292
+
293
+
| Name | Required/ Repeating | Type | Notes |
294
+
| --- | --- | --- | --- |
295
+
|**expression**|Required |expression |Expression to be evaluated |
If the expression can be evaluated to a string type, then the IsString function evaluates to True.
307
+
308
+
**Parameters:**<br>
309
+
310
+
| Name | Required/ Repeating | Type | Notes |
311
+
| --- | --- | --- | --- |
312
+
|**expression**|Required |expression |Expression to be evaluated |
313
+
314
+
---
315
+
### Item
316
+
**Function:**<br>
317
+
Item(attribute, index)
318
+
319
+
**Description:**<br>
320
+
The Item function returns one item from a multi-valued string/attribute.
321
+
322
+
**Parameters:**<br>
323
+
324
+
| Name | Required/ Repeating | Type | Notes |
325
+
| --- | --- | --- | --- |
326
+
|**attribute**|Required |Attribute |Multi-valued attribute to be searched |
327
+
|**index**|Required |Integer | Index to an item in the multi-valued string|
328
+
329
+
**Example:**<br>
330
+
Item([proxyAddresses], 1)
331
+
85
332
---
86
333
### Join
87
334
**Function:**<br>
@@ -99,6 +346,29 @@ If one of the source values is a multi-value attribute, then every value in that
99
346
|**separator**|Required |String |String used to separate source values when they are concatenated into one string. Can be "" if no separator is required. |
100
347
|**source1 … sourceN**|Required, variable-number of times |String |String values to be joined together. |
101
348
349
+
---
350
+
### Left
351
+
**Function:**<br>
352
+
Left(String,NumChars)
353
+
354
+
**Description:**<br>
355
+
The Left function returns a specified number of characters from the left of a string.
356
+
If numChars = 0, return empty string.
357
+
If numChars < 0, return input string.
358
+
If string is null, return empty string.
359
+
If string contains fewer characters than the number specified in numChars, a string identical to string (that is, containing all characters in parameter 1) is returned.
360
+
361
+
**Parameters:**<br>
362
+
363
+
| Name | Required/ Repeating | Type | Notes |
364
+
| --- | --- | --- | --- |
365
+
|**String**|Required |Attribute | The string to return characters from |
366
+
|**NumChars**|Required |Integer | A number identifying the number of characters to return from the beginning (left) of string|
367
+
368
+
**Example:**<br>
369
+
Left("John Doe", 3)
370
+
Returns "Joh"
371
+
102
372
---
103
373
### Mid
104
374
**Function:**<br>
@@ -143,6 +413,24 @@ Flips the boolean value of the **source**. If **source** value is "*True*", retu
143
413
| --- | --- | --- | --- |
144
414
|**source**|Required |Boolean String |Expected **source** values are "True" or "False". |
145
415
416
+
---
417
+
### RemoveDuplicates
418
+
**Function:**<br>
419
+
RemoveDuplicates(attribute)
420
+
421
+
**Description:**<br>
422
+
The RemoveDuplicates function takes a multi-valued string and make sure each value is unique.
423
+
424
+
**Parameters:**<br>
425
+
426
+
| Name | Required/ Repeating | Type | Notes |
427
+
| --- | --- | --- | --- |
428
+
|**attribute**|Required |Multi-valued Attribute |Multi-valued attribute that will have duplicates removed|
429
+
430
+
**Example:**<br>
431
+
RemoveDuplicates([proxyAddresses])
432
+
Returns a sanitized proxyAddress attribute where all duplicate values have been removed
433
+
146
434
---
147
435
### Replace
148
436
**Function:**<br>
@@ -292,6 +580,35 @@ Takes a *source* string value and converts it to upper case using the culture ru
292
580
|**source**|Required |String |Usually name of the attribute from the source object. |
293
581
|**culture**|Optional |String |The format for the culture name based on RFC 4646 is *languagecode2-country/regioncode2*, where *languagecode2* is the two-letter language code and *country/regioncode2* is the two-letter subculture code. Examples include ja-JP for Japanese (Japan) and en-US for English (United States). In cases where a two-letter language code is not available, a three-letter code derived from ISO 639-2 is used.|
294
582
583
+
---
584
+
### Word
585
+
**Function:**<br>
586
+
Word(String,WordNumber,Delimiters)
587
+
588
+
**Description:**<br>
589
+
The Word function returns a word contained within a string, based on parameters describing the delimiters to use and the word number to return. Each string of characters in string separated by the one of the characters in delimiters are identified as words:
590
+
591
+
If number < 1, returns empty string.
592
+
If string is null, returns empty string.
593
+
If string contains less than number words, or string does not contain any words identified by delimiters, an empty string is returned.
594
+
595
+
**Parameters:**<br>
596
+
597
+
| Name | Required/ Repeating | Type | Notes |
598
+
| --- | --- | --- | --- |
599
+
|**String**|Required |Multi-valued Attribute |String to return a word from.|
600
+
|**WordNumber**|Required | Integer | Number identifying which word number should return|
601
+
|**delimiters**|Required |String| A string representing the delimiter(s) that should be used to identify words|
602
+
603
+
**Example:**<br>
604
+
Word("The quick brown fox",3," ")
605
+
Returns "brown"
606
+
607
+
Word("This,string!has&many separators",3,",!&#")
608
+
Returns "has"
609
+
610
+
---
611
+
295
612
## Examples
296
613
### Strip known domain name
297
614
You need to strip a known domain name from a user’s email to obtain a user name. <br>
0 commit comments