Writing Expressions
An expression is text with ${name} tokens. Zetect replaces each token with the value of the attribute it names and uses the result. Expressions only substitute values: they have no operators, functions or conditions.
Provisioning mappings, identity matching, identity source attribute mapping and the single sign-on NameID. See Where They Are Used.
Administrator access to the console, with access to the screen where you edit the mapping.
Expression syntax
| Element | Behaviour |
|---|---|
| Plain text | Copied as it is. Text with no tokens is a fixed value. |
${name} | Replaced with the value of the attribute called name. |
| Several tokens | Each is replaced in place. Text and tokens mix freely: ${firstName}.${lastName}@example.com. |
| Missing or empty attribute | The token becomes empty text. It is never an error. |
| Attribute names | Must match exactly, including case. Everything between ${ and } is the name, so ${ firstName } looks for an attribute called firstName with spaces and finds nothing. |
${ without a closing } | Left in the result as typed. |
There is no way to escape a token, so you can't produce the literal text ${name} from an expression.
Available attributes
The attributes a token can name depend on the screen. On Provisioning mappings and Identity matching, the attribute chips under the editor list them.
| Screen | Tokens name | Example |
|---|---|---|
| Provisioning mappings | Identity attributes, by attribute name | ${firstName}.${lastName} |
| Identity matching | Attributes of the discovered account | ${givenName}.${sn} |
| Identity source attribute mapping | Fields of the source record | ${givenName} ${surname} |
| Single sign-on NameID | Identity attributes, by attribute name | ${employeeId}@example.com |
Writing an expression
To fill an account attribute with an expression:
- Open the application and select Provisioning mappings under Map.
- Select Add Mapping and choose the Account Attribute.
- In Source, choose Expression.
- In Value, type the fixed parts of the value.
- Place the cursor where an attribute value belongs and select its attribute chip to insert the token.
- Select Save Mappings.
The expression is worked out the next time Zetect creates or updates an account, as set by Send on. If the whole result is blank, the attribute is not sent.
Examples
For a person with firstName Priya, lastName Sharma, department Finance, displayName Priya Sharma and no middleName:
ACTIVE
→ ACTIVE
${firstName}.${lastName}
→ Priya.Sharma
${firstName}.${lastName}@example.com
→ Priya.Sharma@example.com
CN=${displayName},OU=${department},DC=example,DC=com
→ CN=Priya Sharma,OU=Finance,DC=example,DC=com
${firstName} ${middleName} ${lastName}
→ Priya Sharma (two spaces: the missing middle name is empty)
When to use a transform instead
Use a Transform when you need more than substitution:
- change case or trim spaces, such as a lower-case login name
- a fallback when an attribute is blank
- map one value to another, such as a department to an organisational unit
- take part of a value, such as the text before
@ - reformat a date or do arithmetic
Every text option in a transform uses the same ${name} tokens, so you can move an expression into a transform unchanged. See Using Transforms.
Troubleshooting
- A token comes out empty. Check the attribute name against the chips. Names are case-sensitive, and on Identity matching they are account attribute names, not identity attribute names.
- Stray separators in the result. A missing attribute leaves its surrounding text behind, such as
.Sharma. Use a transform with a fallback if the attribute can be blank.
