- Q. How can I collect multiple attributes in the same node where some are required and some are optional?
- Q. How do I know what policy will be used to validate a user's input?
- Q. When is an attribute validation policy evaluated?
- Q. How do I ensure an attribute is mandatory when I use policy validation?
- Q. How do I return a custom error message using the Scripted Decision node?
- Q. How can I reference environment-specific secret or non-secret values in a Scripted Decision node?
- Q. How do I debug an end user journey?
Q. How can I collect multiple attributes in the same node where some are required and some are optional?
A. If you include multiple attributes in a single Attribute Collector Node, they must all be required or all optional.
If you want attributes to have different validation options, you can use multiple Attribute Collector nodes to specify whether individual attributes are required or optional. You can then include these Attribute Collector nodes in a single Page Node to present them on the same page in the end user journey.
A. When you use the Attribute Collector Node for user input, you can choose whether the input value for an attribute is validated or not by selecting the Validate Input option.
To find out what validation policies are defined for an attribute, you can navigate to: Native Consoles > Identity Management > Configure > Managed Objects > [Managed Object Type] and click the name of the attribute (property) you are interested in. On the Validation tab, you will see a list of policies that have been added to the attribute. See Default Policy Reference for further details about these policies.
A. If an attribute has a validation policy attached to it, the policy will always be evaluated when there is user input, even if the attribute has been marked as optional in the Attribute Collector node. If a non-required field has data within it, the policy will be evaluated.
If you have a Scripted Decision Node that removes an attribute’s value (that is, by setting the value to null), then all policies attached to all attributes for the managed object (for example, alpha_user) will be re-evaluated when the object is updated/patched with the null value.
To make an attribute mandatory:
- Add a new policy by navigating to: Native Consoles > Identity Management > Configure > Managed Objects > [Managed Object Type] and clicking the name of the attribute (property) you want to make mandatory.
- Select the Validation tab, click Add Policy, enter
not-emptyin the Policy Id field and click Add.
- Return to the Attribute Collector node in your journey and make the following changes to ensure policies are used which give user feedback:
- Deselect the All Attributes Required option.
- Select the Validate Input option.
A. You can include the following in your script to define a custom error message:sharedState.put("errorMessage", "custom error message")
outcome = "false"
Q. How can I reference environment-specific secret or non-secret values in a Scripted Decision node?
A. You can include environment secrets and variables (ESVs) in your scripts as detailed in Use ESVs in Scripts.
A. In your Development environment, you can use debug mode as described here: Debug Identity Cloud End-user Journeys.
If you need to debug a journey in a different environment, you can include a Scripted Decision node for debugging. See GitHub: Scripted Decision Debugger for some examples to get you started.
Please be aware that script debug statements will be visible to ForgeRock support, so you should ensure you do not log any personally identifiable information (PII) or any sensitive information.
Writing scripts for end user journeys is outside the scope of ForgeRock support; if you want more tailored advice, consider engaging Deployment Support Services.