Set State node
The Set State node lets you set the values of any configured attributes in the shared state. The node removes any previous values of the specified attributes from all states (transient, secure, and shared) and resets them to the configured values in the shared state.
Don’t use this node to add sensitive data, such as passwords, to the shared state. |
Compatibility
Product | Compatible? |
---|---|
Advanced Identity Cloud |
Yes |
Access Management (self-managed) |
Yes |
ForgeRock Identity Platform (self-managed) |
Yes |
Configuration
Property | Usage |
---|---|
Attributes |
Add the attributes you want to set in the shared state. For each attribute:
|
Example
The following sample journey assumes that an organization wants to overwrite the costCenter
of specific employees
when they authenticate.
-
If an employee doesn’t have a
costCenter
attribute in their profile, the journey proceeds without changing the user object. -
If the user does have a
costCenter
attribute, the journey uses the Set State node to overwrite the value of that attribute.
![journey set state](_images/journey-set-state.png)
The user has already authenticated before beginning this journey:
-
The Get Session Data node gets the
userName
from the session. -
The Attribute Present Decision node checks the user object to determine whether the user has a
costCentre
attribute.-
If the user doesn’t have a
costCentre
attribute, the journey proceeds to the success outcome. -
If the user does have a
costCentre
attribute, the Attribute Present Decision node stores its value in the shared state.
-
-
The Set State node overwrites the value of the
costCentre
attribute with the value set in the node configuration. -
The Patch Object node node updates the user object with the new
costCentre
. -
If the patch of the user object is successful, the journey proceeds to the success outcome; otherwise, the journey follows the failure outcome.