Write Custom User Data
Updates custom user data stored by Mosaic for your application
Description
This step is used to manage custom user data stored by Mosaic for your application. For example, this step can be used to note a preference for email vs SMS OTP delivery.
This step evaluates the data expression at runtime, and then merges the data with the existing custom data stored for the user for the application that initiated the journey. The merge is shallow so the value of a nested object or array will just replace the existing one (see Example below).
Once merged, the updated custom data object is stored in a variable so it can be accessed by subsequent journey steps (using the Read Custom User Data step). However, if the expression cannot be resolved or the merge doesn't succeed, the journey will fail.
Note
Custom user data is limited to 500 KB per application
Configuration
Field | Description |
---|---|
User Auth State | Indicates if the user has authenticated in this journey. - If set to The user is authenticated (default), the user context is provided implicitly by the journey. - If set to The user is not authenticated , a user identifier must be provided. Note that, if the identifier doesn’t exist, a Mosaic user record is automatically created. |
User | User identifier, specified using an expression. Only configured if the journey doesn't authenticate the user before invoking this step. |
Data to update | Additional user custom_data to add or update for the current user, specified in JSON format and using expressions. Default is {} . |
Example
Suppose data to update =
{
"name": {
"first_name" : "bob"
},
"membership" : "gold"
}
And custom data before update =
{
"name": {
"first_name" : "steve",
"last_name" : "jones"
}
}
Then custom data after update =
{
"name": {
"first_name" : "bob"
},
"membership" : "gold"
}