Understanding Value Sources
A value source tells Zetect how to produce one value: copy an attribute, fill in a text template, or run a transform. All three end in the same place, a single piece of text or no value at all. Knowing how each is evaluated, and what happens when data is missing, makes every mapping predictable.
How it works
Each mapping row has a Source. The choices are the same on every screen that offers all three, apart from the name of the first one.
| Source | What it produces | Example |
|---|---|---|
| Identity / Account | The value of one attribute, unchanged. On provisioning mappings the option is Identity and reads the person's identity attribute. On identity matching it is Account and reads the discovered account's attribute. | email |
| Expression | Text in which each ${name} token is replaced by that attribute's value. Text with no tokens is a fixed value. | ${firstName}.${lastName} |
| Transform | The result of a JSON definition run by the transformation engine. | { "type": "uppercase", "input": "${department}" } |
There is no separate static value source. A fixed value is an Expression with no tokens, or a transform of type static. See Using Static Values.
Zetect works out a value in this order:
- It collects the attributes the tokens can refer to. Which attributes these are depends on the screen: identity attributes for provisioning mappings, the account's attributes for identity matching, source fields for identity sources. See Where They Are Used.
- For Identity or Account, it reads the chosen attribute.
- For Expression, it replaces every
${name}token with the attribute's value. A token for an attribute that is missing or empty becomes empty text. - For Transform, it reads the JSON and runs the transform named by
type. Every text option is filled in the same way as an expression before the transform uses it. - It checks the result. A missing or blank result counts as no value, and the screen decides what that means (see Null and empty values).
How a transform is evaluated
- The type picks the operation. The
typeis not case-sensitive, soUppercaseanduppercaseare the same. An unknown type makes the whole transform fail. - Most types work on one input. They read it from the
inputoption. If a step has noinputand runs inside apipeline, it uses the result of the step before it. - Some types ignore the input.
concat,decision,static,uuidandcurrent-datebuild their value from their own options only. - Conditions test attributes. The
whenclause ofdecisionandifcompares named attributes with expected values. It doesn't look at the input or at a pipeline's current value. - Only two places nest transforms. Each step of a
pipelineand thethenandelsebranches ofifcan be full transforms. Everywhere else, such asinput, alookupresult or adecisionresult, expects text. - Depth is limited. Pipelines and
ifbranches can be nested up to 20 levels deep. Deeper definitions fail.
Null and empty values
| Situation | Result |
|---|---|
| Token for a missing attribute | Becomes empty text. ${middleName} for a person with no middle name gives an empty string, not an error. |
| Expression with only some tokens empty | The rest of the text stays. ${firstName}.${lastName} with no first name gives .Sharma. |
| Transform input is missing | Most string, date and numeric types return no value. A step in a pipeline whose previous step returned no value usually returns no value too. |
| Transform cannot run | Malformed JSON, an unknown type or operator, an invalid pattern or a date that can't be read makes the transform return no value. It never stops the operation it is part of. |
| Final result is blank | On provisioning mappings, the attribute is not sent. On identity matching, the rule is skipped and the next rule is tried. |
Types
Every value is text. Attribute values arrive as text, and every result leaves as text.
- Numbers.
mathreads its operands as decimal numbers and returns a number written without trailing zeros, such as2.5or25. Text that isn't a number gives no value. - Whole numbers. Options such as
index,group,days,monthsandyearsmust be whole numbers. You can write them as JSON numbers (90) or text ("90"). A value that isn't a whole number falls back to the option's default. - Dates. Date types read text using a pattern you give, or ISO dates when you give none, and write text in the pattern you ask for.
- Comparisons.
lookupkeys andwhenconditions compare text exactly.ITdoes not matchitorIT.
Example
An application needs a displayName and a department code. The person has these identity attributes:
| Attribute | Value |
|---|---|
| firstName | Priya |
| lastName | Sharma |
| department | finance |
displayName Source: Expression
${firstName} ${lastName}
→ Priya Sharma
department Source: Transform
{ "type": "pipeline",
"steps": [
{ "type": "trim", "input": "${department}" },
{ "type": "uppercase" }
] }
→ FINANCE
Limits and defaults
- Expressions only replace tokens. They have no functions, operators or conditions. Use a transform for anything more.
- Transforms nest up to 20 levels deep.
- The transform editor checks that the text is a JSON object with a
type. It does not check that the type exists or that the options are right, and it does not stop you saving.
