Read Custom User Data

Retrieves custom user data stored by Mosaic for your application

Description

This step allows you to retrieve custom user data that was added using the Write Custom User Data step. For example, custom user data can be used to store membership information for the user. The data is stored by Mosaic as a free-form JSON object.

The user context for this step may be provided implicitly by the journey if the user is already authenticated; otherwise, a user identifier must be specified in the step configuration. When the step is invoked, the data is stored in the configured output variable for the duration of the journey so it can be accessed by subsequent journey steps.

If successful, the step returns the user's custom data for the application and continues to the next step. If it fails, the journey proceeds to a failure branch (if specified); otherwise, the journey is aborted and an error is sent to the client.

Configuration

Field Description
User Auth State Indicates if the user has authenticated in this journey. If the user is authenticated (default), the user context is provided implicitly by the journey. If not, a user identifier must be configured.
User Identifier User identifier, specified using an expression. Only configured if the journey doesn't authenticate the user before invoking this action.
Output Variable Name of the variable that stores the user's custom data.

Example

Consider custom user data that stores membership information about the user. For example:

Copy
Copied
{
    "membership": {
        "level" : "Gold"
    }
}

Suppose a journey caters the login experience based on membership level. In our example, this step will be used to retrieve the user's custom data and store it in a variable named customData. A subsequent step can then determine the user's membership level using this expression: customData.membership.level