Configuring auto-populated fields for customer profiles
This feature allows to configure the automatic population of fields within a customer profile, including extended attributes. When you don't find any customer profiles upon search in Associate App, you can create a new profile using the search string. The search string, which you look for during the customer profile search in Associate App, is populated in the first matching customer profile field.
Pre-requisites
The feature is disabled by default. To enable auto-populate fields for your business:
Use the Update app configuration.
Set
release_toggle
>new_customer_profile
totrue
.ImportantEnabling this feature will disrupt any active custom app extensions that you have configured for customer profile screens in the app.
For
customizations
>customer_profile_auto_populate_fields
, add multiple objects containing afield_path
and a correspondingregex
pattern.noteThe first matching regex will be used for the specified field. The auto-population model uses the first matching identifier. We recommend you to arrange the identifiers in a hierarchical order, starting with the most precise ones and progressing towards more abstract ones.
After making any changes to the configuration, restart all running apps for the auto-populated fields to take effect.
Field path
This is the object representation of a customer profile:
{
"email": "test@newstore.com",
"extendedAttributes": {
"loyalty_id": {
"data_type": "string",
"value": "loyal123"
}
},
"fullName": "Tim Clienteling",
"phoneNumber": ""
}
For a first-level key, set the path by using a key name as the field_path
. For example, email
.
To set an extended attribute, you have to specify an extendedAttributes.{key_name}
. For example, extendedAttributes.loyalty_id
.
Regex
The regex patterns support JavaScript syntax. If a regex matches the search value, the value is used to populate the field specified in the field_path
.
Example
The auto-populated fields for customer profiles:
{
"customizations": {
"customer_profile_auto_populate_fields": [
{
"field_path": "email",
"regex": "^.+@[^\\.].*\\.[a-z]{2,}$"
},
{
"field_path": "extendedAttributes.loyalty_id",
"regex": "^loya[0-9]{4}$"
}
]
}
}
Related topics