Skip to main content

How to create or update contacts in Salesforce

Updated over a week ago

Summary

This guide explains how to configure the Salesforce - create or update contact action in Astra. This action keeps your Salesforce data up to date by automatically creating or updating contact records based on customer conversations.

How this action works

When this action runs:

  • Astra looks for a Contact in Salesforce using the customer’s email.

  • If the contact exists, it updates the mapped fields.

  • If the contact does not exist, it can create a new one (based on your settings).

Instructions

Follow these steps to configure the Salesforce action:

Step 1: Open the Salesforce create/update contact template

  • Log into your Astra account.

  • Go to the Action Library.

  • Select Salesforce - create or update contact.

  • Open the Configuration step.

Step 2: Set up the action intent

  • What you do:

    • Enter a clear action name and intent.

    • Click Edit action intent anytime to update it.

  • What happens:

    • A clear and detailed intent helps the agent decide when to use this action.

  • Offline Sync:

    • Keep this OFF to run the action during the conversation.

    • Turn it ON to run the action after the conversation ends.

Step 3: Select your Salesforce account

  • What you do:

    • Choose an existing Salesforce account or click Add account to connect a new one.

  • What happens:

    • All data created or updated by this action will be saved in the selected account.

Step 4: Configure contact creation and updates

Allow creating and updating new contacts

  • When ON:

    • Creates a new contact if one does not exist.

    • Fully updates contacts that were originally created through Astra.

  • When OFF:

    • Does not create new contacts.

Allow updating existing fields

  • When ON:

    • Updates mapped fields for contacts that already exist in Salesforce, even if they were not created through Astra.

  • When OFF:

    • Does not modify existing contact fields.

    • Only updates the summary field (if configured).

Step 5: Map fields (Salesforce → Astra)

Field mapping defines how data from Astra is written into Salesforce.

  • What you do:

    • For each row:

      • Select a Salesforce Contact field (left side).

      • Match it with an Astra field (right side).

  • What happens:

    • When the action runs, Astra sends the mapped data to the corresponding fields in the Salesforce Contact record.

Required fields

You must map the following fields:

  • Email

  • Last name

The action will not run without these.

Adding more fields

  • Click Map field to add more mappings.

  • You can map:

    • Standard fields (Email, Phone, etc.)

    • Custom fields from your Salesforce account

Note: Only certain field types are supported:

  • String

  • Email

  • Phone

  • Text

  • Text area

  • URL

  • Picklist

Fields must also be enabled for both create and update in Salesforce.

Creating new Astra fields

  • You can create new Astra fields while mapping.

  • If you access configuration from the Agent page:

    • These fields can also be saved as contact attributes

    • Existing attributes may appear for selection

Using the summary field

  • If you map a Salesforce field to Summary:

    • Astra writes a conversation summary into that field.

    • It is recommended to map this to a long text custom field for better readability.

What does the end-to-end behavior look like

Here’s what happens when the action runs:

  • Astra searches for a Contact using the mapped email.

  • If no contact exists:

    • A new contact is created only if allowed by your settings.

  • If a contact exists:

    • The contact is updated based on your configuration.

    • If full updates are restricted, only summary-related updates may occur.

Additional feature: Offline Sync

Offline Sync allows the action to run after the conversation ends instead of during it.

  • When enabled:

    • The action runs once after the conversation is complete.

  • Conversation end conditions:

    • Text agent: 10 minutes after the last message

    • Voice agent: When the call ends

This is useful when you want to sync finalized data instead of updating records in real time.

What to do next

Once configured, this action will:

  • Automatically capture customer details

  • Keep your Salesforce contacts updated

  • Reduce manual data entry

You can now include this action in your Astra agents to keep your Salesforce CRM data accurate and up to date.

Did this answer your question?