---
title: "Configuring auto-populated fields for customer profiles"
slug: "configuring-auto-populated-fields-for-customer-profiles"
tags: ["identifier", "config api", "Associate App configuration", "Associate App", "scan", "customer", "tutorial", "api", "scanner", "profile"]
updated: 2024-11-12T12:56:27Z
published: 2024-11-12T12:56:27Z
canonical: "docs.newstore.com/configuring-auto-populated-fields-for-customer-profiles"
---

> ## Documentation Index
> Fetch the complete documentation index at: https://docs.newstore.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 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:

1. Use the [Update app configuration](https://docs.newstore.net/api/configuration/apps/associate-app-config-api_config#operation/putConfig).
2. Set `release_toggle` > `new_customer_profile` to `true`.

> [!NOTE]
> Important
> 
> Enabling this feature will disrupt any active custom app extensions that you have configured for customer profile screens in the app.
3. For `customizations` > `customer_profile_auto_populate_fields`, add multiple objects containing a `field_path` and a corresponding `regex` pattern.

> [!TIP]
> Note
> 
> The 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.

> [!NOTE]
> Important
> 
> 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:

```json
{
      "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:

```json
{
    "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**

- [Configuring scanner identifiers for customer profiles](/v1/docs/configuring-scanner-identifiers-for-customer-profiles#config-aa-customer-profile-scanner-identifiers)

<style> p[data-block-id] {font-size:1rem;} ul li p[data-block-id] {margin-bottom: 0;} ul[data-type="taskList"] li div p[data-block-id] {margin-bottom: 0;} ol li p[data-block-id] {margin-bottom: 0;} table tbody th p[data-block-id] { margin-bottom: 0;} blockquote p[data-block-id] {margin-bottom: 0 !important;} &nbsp;p[data-block-id]:empty::after {content: "\00A0";} </style>
