Control Display of Guided Journey Based on User Roles

In this example, you want to display a page-level guided journey in the Change Assignment page for HR specialist users.

In the Page Properties pane, select the page property to set the guided journey code at the page level. Enter the default value for the following page property:

  • Set Guided Journeys Code at the page level: [[ $application.user.roles.includes('HR_SPECIALIST_-_VIEW_ALL_DATA') ? 'GUIDED_JOURNEY_FOR_CHANGE_ASSIGNMENT' : null ]] where
    • HR_SPECIALIST_-_VIEW_ALL_DATA is the user role code
    • GUIDED_JOURNEY_FOR_CHANGE_ASSIGNMENT is the task code

It will show all the tasks defined in the Guided Journey to your HR specialist user.

You can define the same expression at the task code level to show a subset of tasks. Enter the default value for the following page property:

  • Set Guided Journeys Task Codes at the page level: [[ $application.user.roles.includes('HR_SPECIALIST_-_VIEW_ALL_DATA') ? 'KNOW_BEFORE_YOU_START' : null ]] where
    • HR_SPECIALIST_-_VIEW_ALL_DATA is the user role code
    • KNOW_BEFORE_YOU_START is a task code defined in the GUIDED_JOURNEY_FOR_CHANGE_ASSIGNMENT guided journey.
Note:

Simple expression based on the user roles can apply to any page property of any type. Displaying a guided journey conditionally is just one illustration. The user role is the only condition available across applications.