Find Function
Find Function

Find Function

This function is used to extract the part of the AD attribute value.
Params JSON Parameters for Find Function
Attribute Name
Data Type
Description
value
String
Value field on which regex pattern is applied. This could be the combinations of one or many AD attributes or constants strings.


For example, if the AD attribute value of given name
is paul, ${givenname}@pttpro is evaluated as
paul@pttpro

If the value requires backslash (\) or double quotes, then these characters should be escaped with another backslash (\).For example, value pttpro\${givenname} should be given as pttpro\\${givenname}.
pattern
String
regex pattern to be applied on the value.
If the pattern requires backslash (\) or double quotes, then these characters should be escaped with another backslash (\). For example; pattern ^\


For example; pattern ^\d{4} should be given as ^\\d{4}

index (optional)
Integer
If the pattern matches with multiple values:-


If value is less than 0, then returns all the matching regex
expression value separated by comma.


If value is greater than or equal to 0, then returns the
pattern value at the given index.


Default Value: 0

group (optional)
Integer
If the regex uses grouping, it returns the group value.


Default value:0

Example 1
Map the user attribute department to the AD attribute extensionattribute7. The extensionattribute7 value in AD is 1024-0843 SS-Apparel function mapping for department attribute.
" function":"find", "params":{ "value":"${extensionattribute7}", "pattern":"^\\d{4}", "index": 0, "group": 0 }}
This should extract first 4 digits from extensionattribute7 AD attribute value and map to the user attribute department.
Example 2
if the member of AD attribute has the following value
[ "CN=Smartphones_SM1,OU=Security Groups,OU=Groups,OU=East,OU=Resources,DC=rona,DC=ca", "CN=Smartphones_SM2,OU=Security Groups,OU=Groups,OU=East,OU=Resources,DC=rona,DC=ca", "CN=Smartphones_SM3,OU=Security Groups,OU=Groups,OU=East,OU=Resources,DC=rona,DC=ca" ] User Role Level mapping mapping with below find function mapping results in same list of role levels with comma separation { "function": "find", "params": { "value": "${memberof}", "pattern": "CN=(.?),", "index": -1, "group": 1 } }
is converted as Smartphones_SM1, Smartphones_SM2, Smartphones_SM3