Skip to main content

Predefined functions

Identity Manager provides a set of predefined functions that simplify the configuration of entity property expressions and scalar rules. See the Entity Type andResource Type topics for additional information.

Unlike C# expressions, Identity Manager's predefined functions do not need any prefix. They can be used as such. See the C# utility functions topic for additional information.

Examples

The following example shows two predefined functions. The first function normalizes the HR_Person FirstName. The other one converts the end date into a UTC date and adds 1440 minutes.

Code attributes enclosed with <> need to be replaced with a custom value before entering the script in the command line.

        <ScalarRule Property="CFirstName" Binding="HR_Person:FirstName" Expression="Simplify" Policy="Default" />
       <ScalarRule Property="CEndDate" Binding="HR_Person:EndDate" Expression="ParseLocalDateThenAddMinutes:Romance Standard Time|dd/MM/yyyy|1440" Policy="Default" />

The following table summarizes existing predefined functions:

NameDescriptionParametersReturn type
ToUpperReturns the input string converted to uppercase, using the current culture.NoneString
ToLowerReturns the input string converted to lowercase, using the current culture.NoneString
SimplifyReturns the input string converted to uppercase, removing all whitespace and special characters, and replacing diacritics.NoneString
TrimRemoves all leading and trailing white-space characters from the current string.NoneString
TrimStartRemoves all leading white-space characters from the current string.NoneString
TrimEndRemoves all trailing white-space characters from the current string.NoneString
RemoveDiacriticsReplaces accented characters with ASCII equivalents: é/è/ê → e, ç → c, à → a, ù → u, ä → ae, Ä → AE, ö → oe, Ö → OE, ü → ue, Ü → UE, č → c, Č → C, ø → o, Ø → O, ł → l, Ł → L, ß → ss, æ → ae, Æ → AE, œ → oe, Œ → OE, š → sh, Š → SH.NoneString
ToDoubleMetaphoneAn implementation of Double Metaphone phonetic algorithm.NoneString
ToSoundexAn implementation of Soundex phonetic algorithm.NoneString
ToFirstNameNormalizes a first name (first character of each word in uppercase) separated with space, hyphen, or apostrophe and the right accents.NoneString
ToTitlePuts the first character in uppercase.NoneString
ToFormatedDNReturns the input string converted to Distinguished Name format.NoneString
ParseLocalDateConverts the specified string representation of a date and time to its DateTime equivalent using the specified parameters.Time zone identifierInput string format.
ParseLocalDateThenAddMinutesConverts the input string into a DateTime and adds minutes value.Time zone identifierInput string format
ParseUniversalDateConverts the specified string representation of a date and time to its Coordinated Universal Time (UTC).Input string format.DateTime
ParseUniversalDateThenAddMinutesConverts the input string into an UTC DateTime and adds minutes value.Time zone identifierInput string format
FormatLocalDateConverts the specified string into a local DateTime.Time zone identifierInput string format.