Worked Mapping Examples
Complete, realistic mappings you can adapt: a directory account built from identity data, identity matching rules that clean up account values, a dormancy timestamp for risk scoring, and an identity source that combines fields. Each shows the attributes going in and the value that comes out.
The application or source is onboarded and its attributes are listed. See Onboarding an Application.
Administrator access to the console, with access to the screen where you edit the mapping.
Directory account from identity data
A directory application needs a login name, display name, email, location in the directory and a fixed description. The person's identity attributes are:
| Identity attribute | Value |
|---|---|
| firstName | Priya |
| lastName | Sharma |
| Priya.Sharma@example.com | |
| department | IT |
| location | India |
To build the mappings:
- Open the application and select Provisioning mappings under Map.
- Add one row per account attribute, with the Source, Value and Send on shown below.
- Select Save Mappings.
| Account Attribute | Source | Value | Send on | Result |
|---|---|---|---|---|
| sAMAccountName | Transform | Login name pipeline, below | Create only | priya.sharma |
| displayName | Expression | ${firstName} ${lastName} | Create & update | Priya Sharma |
| Identity | email | Create & update | Priya.Sharma@example.com | |
| distinguishedName | Transform | Location decision, below | Create only | CN=Priya Sharma,OU=India,OU=IT,DC=example,DC=com |
| description | Expression | Managed by Zetect | Create only | Managed by Zetect |
Login name pipeline: the part of the email before @, in lower case.
{
"type": "pipeline",
"steps": [
{ "type": "split", "input": "${email}", "delimiter": "@", "index": 0 },
{ "type": "lowercase" }
]
}
Priya.Sharma@example.com → Priya.Sharma → priya.sharma
Location decision: the first rule whose conditions all match wins.
{
"type": "decision",
"rules": [
{ "when": { "department": "IT", "location": "India" },
"then": "CN=${firstName} ${lastName},OU=India,OU=IT,DC=example,DC=com" },
{ "when": { "department": "IT", "location": "USA" },
"then": "CN=${firstName} ${lastName},OU=USA,OU=IT,DC=example,DC=com" }
],
"default": "CN=${firstName} ${lastName},OU=Users,DC=example,DC=com"
}
department = IT, location = India → CN=Priya Sharma,OU=India,OU=IT,DC=example,DC=com
department = HR, location = India → CN=Priya Sharma,OU=Users,DC=example,DC=com
Matching accounts whose values don't line up
In this application, accounts report userPrincipalName as psharma@corp.example.com and mail in mixed case, while Zetect holds username psharma and email priya.sharma@example.com.
To match on cleaned-up account values:
- Open the application and select Identity matching under Map.
- Select Add rule. After Match when, choose username. After equals, choose Transform and enter the first transform below.
- Select Add rule again. After Match when, choose email. After equals, choose Transform and enter the second transform below.
- Select Save rules.
- Run an account sync so the rules are applied.
Rule 1 — username equals
{ "type": "split", "input": "${userPrincipalName}", "delimiter": "@", "index": 0 }
psharma@corp.example.com → psharma
Rule 2 — email equals
{ "type": "lowercase", "input": "${mail}" }
Priya.Sharma@Example.com → priya.sharma@example.com
Tokens on this screen read the account's attributes. If an account has no userPrincipalName, rule 1 produces no value and is skipped, and rule 2 is tried.
Dormancy from a directory timestamp
The Dormant Account risk signal needs a UTC timestamp, but the directory reports lastLogonTimestamp as a Windows file time such as 133500000000000000.
To convert it before scoring:
- Go to Identity Security → Provisioning Risk, or open the application's Risk rules under Govern.
- On the Dormant Account signal, set Evaluate from (account attribute) to
lastLogonTimestamp. - Select Transform value before comparing and enter the transform below.
- Select Save transform, then save the rules.
{
"type": "date-format",
"input": "${value}",
"sourceFormat": "windows-filetime",
"targetFormat": "yyyy-MM-dd'T'HH:mm:ss'Z'"
}
133500000000000000 → 2024-01-17T21:20:00Z
This is the windows-filetime starter offered in the mapping editor. For Unix timestamps, use epoch-seconds or epoch-millis as the sourceFormat.
Contract end date in another format
An application wants the account end date as MM/dd/yyyy, 30 days after the contract end date Zetect holds as 2026-12-31.
{
"type": "date-add",
"input": "${contractEndDate}",
"sourceFormat": "yyyy-MM-dd",
"days": 30,
"targetFormat": "MM/dd/yyyy"
}
2026-12-31 → 01/30/2027
A person with no contract end date gets no value, so the attribute is not sent.
Identity source display name
The source has givenName and sn fields but no display name.
To combine them:
- Go to Identity → Identity Sources, open the source and select Attribute Mapping.
- Select + Add Row and switch the row to Expression.
- Enter
${givenName} ${sn}and choose displayName as the Zetect Attribute. - Select Save Mappings.
givenName = Priya, sn = Sharma → Priya Sharma
The new mapping applies from the next sync. Identity sources accept expressions only, not transforms.
