Zetect Expressions & Transforms Back to zetect.inSwitch portal ⇄

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.

SourceWhat it producesExample
Identity / AccountThe 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
ExpressionText in which each ${name} token is replaced by that attribute's value. Text with no tokens is a fixed value.${firstName}.${lastName}
TransformThe 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:

  1. 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.
  2. For Identity or Account, it reads the chosen attribute.
  3. 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.
  4. 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.
  5. 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 type is not case-sensitive, so Uppercase and uppercase are the same. An unknown type makes the whole transform fail.
  • Most types work on one input. They read it from the input option. If a step has no input and runs inside a pipeline, it uses the result of the step before it.
  • Some types ignore the input. concat, decision, static, uuid and current-date build their value from their own options only.
  • Conditions test attributes. The when clause of decision and if compares 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 pipeline and the then and else branches of if can be full transforms. Everywhere else, such as input, a lookup result or a decision result, expects text.
  • Depth is limited. Pipelines and if branches can be nested up to 20 levels deep. Deeper definitions fail.

Null and empty values

SituationResult
Token for a missing attributeBecomes empty text. ${middleName} for a person with no middle name gives an empty string, not an error.
Expression with only some tokens emptyThe rest of the text stays. ${firstName}.${lastName} with no first name gives .Sharma.
Transform input is missingMost 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 runMalformed 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 blankOn 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. math reads its operands as decimal numbers and returns a number written without trailing zeros, such as 2.5 or 25. Text that isn't a number gives no value.
  • Whole numbers. Options such as index, group, days, months and years must 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. lookup keys and when conditions compare text exactly. IT does not match it or IT .

Example

An application needs a displayName and a department code. The person has these identity attributes:

AttributeValue
firstNamePriya
lastNameSharma
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.