## What are Integration Fields?

Integration fields automatically populate custom fields in Salesforce or Kustomer when a chat conversation is handed off to a live agent. Information collected during the chat gets stored in **Smart Fields** in Assembled, then automatically written to your platform's custom fields.

**Example**: A customer provides their account number during chat → Assembled saves it in a Smart Field → When handed off to an agent, the account number appears in the Salesforce case's "Account Number" field.

## How It Works

1. **Create** [**Smart Fields**](https://support.assembled.com/hc/en-us/articles/38929586958733-Smart-Fields-in-Assembled-AI) in Assembled to hold customer information (like "Priority Level" or "Account Number")
2. **Import your platform custom fields** as Integration Fields
3. **Connect Smart Fields to Integration Fields** so Assembled knows which data goes where
4. **Collect data** during conversations via workflows or handoff forms
5. **Automatic handoff** writes Smart Field values to your platform fields

## Setup Steps

### Step 1: Create or Configure Smart Fields

1. Go to **Settings > Info Fields > Smart Fields**
2. Create a new Smart Field
   - **Name**: What you'll call it in Assembled (e.g., "Customer Priority")
   - **Type**: Text, Number, True/False, or Dropdown
   - **Description**: What information this field contains

**Tip**: Choose descriptive names that make sense to your team.

### Step 2: Import Your Platform Fields

1. Go to **Settings > Info Fields > Integration Fields**
2. Click **Import from [Salesforce/Kustomer]**
3. Select which custom fields you want to use
4. Click **Import**

Assembled creates an Integration Field for each selected platform field.

### Step 3: Connect Smart Fields to Integration Fields

1. Within **Settings > Info Fields > Integration Fields**
2. Click on the Integration Field you want to configure
3. In the **Input Fields** section, select which Smart Field(s) should populate this platform field
4. Save the Integration Field

### Step 4: Collect Data in Conversations

Choose how you want to collect information:

**Option A: Workflows**

- Create a workflow that gathers/populates the Smart field either through a "Guide" or "Collect Information" step
- Set instructions like "Ask for the customer's account number"
- Select which Smart Field to store the answer in
- End the workflow with a a "Handoff" step

**Option B: Handoff Forms**

- Go to **Chat Settings > Handoff**
- Under "Collect customer information," add Smart Fields you want users to fill out
- These fields will appear as a form when escalating to an agent

**Option C: Authenticated User Data**

- Go to **Chat Settings > Setup**
- Under "User data mapping" map data from your authentication (like email, account ID) to Smart Fields
- This data automatically populates when users are logged in and using the Chat

### Step 5: Test It

1. Start a test chat conversation
2. Collect information into your Smart Fields (either via workflow or manually)
3. Hand off the chat to an agent
4. Check your platform (Salesforce/Kustomer) to verify the custom fields are populated

## Example Setup: Customer Account Tier

**Goal**: Automatically populate a customer's account tier in Salesforce during chat handoff.

**Setup**:

1. **Smart Field**: Name: "Account Tier", Type: Dropdown, Options: Free, Premium, Enterprise
2. **Integration Field**: Import Salesforce field "Account_Tier__c"
3. **Connect**: Edit "Account_Tier__c" integration field → Select "Account Tier" smart field → Map values:   - Free → `tier_free`
   - Premium → `tier_premium`
   - Enterprise → `tier_enterprise`
4. **Workflow**: Create "Collect Information" step → Ask "What type of account do you have?" → Store in "Account Tier" (selected under 'Information to collect')
5. **Test**: Run a chat, answer "Premium", hand off → Salesforce case shows `tier_premium` in Account_Tier__c field

## Important Notes

- **All Smart Fields with connections get written** to your platform at handoff, not just the ones in handoff forms
- **Empty fields are skipped** - if a Smart Field has no value, it won't update the platform field
- **Timing**: Data is written when the case is created during handoff
- **Field location**: For Salesforce, make sure your custom fields are on the **Case object**, not Contact or Account

## Troubleshooting

**Smart Field not showing up in platform:**

- Verify the Integration Field connection is saved
- Check that the Smart Field had a value before handoff. For a particular conversation, check the QA review page shows the Smart Field value is stored
- Confirm the platform custom field exists and your integration has permission to update it
- For dropdown fields, verify value mappings are correct

**Need Help?** Contact your AI Deployment Strategist or Assembled Support for assistance with configuration.
