Scriptable conditions in a mapping
By default, Advanced Identity Cloud synchronizes all attributes in a mapping. For more complex relationships between source and target objects, you can define conditions under which Advanced Identity Cloud maps certain attributes. You can define two types of mapping conditions:
-
Scriptable conditions, in which an attribute is mapped only if the defined script evaluates to
true. -
Condition filters, a declarative filter that sets the conditions under which the attribute is mapped. Condition filters can include a link qualifier , that identifies the type of relationship between the source object and multiple target objects. For more information, reference Map a Single Source Object to Multiple Target Objects.
The following list shows examples of condition filters:
-
"condition": "/object/country eq 'France'"—Only map the attribute if the object’scountryattribute equalsFrance. -
"condition": "/object/password pr"—Only map the attribute if the object’spasswordattribute is present. -
"condition": "/linkQualifier eq 'admin'"—Only map the attribute if the link between this source and target object is of typeadmin.
-
Configure mapping conditions using the admin console
To apply a conditional update to a mapping property, use the Advanced Sync editor’s conditional update editor.
Learn more in Define and preview mapping rules.
Scriptable conditions create mapping logic, based on the result of the condition script. If the script does not return true, Advanced Identity Cloud doesn’t manipulate the target attribute during a synchronization operation.
In the following excerpt, the value of the target mail attribute is set to the value of the source email attribute only if the source attribute is not empty:
{
"target": "mail",
"comment": "Set mail if non-empty.",
"source": "email",
"condition": {
"type": "text/javascript",
"source": "(object.email != null)"
}
...
|
You can add comments to JSON files. This example includes a property named |