Skip to main content
The Salesforce Create contact action creates new contact records in your connected Salesforce org. This write action creates a new contact each time it runs and does not update or delete existing contacts.

Limitations

  • As with other Salesforce actions, the exact parameter set and behavior can change over time. Confirm how this action behaves in your own environment before you depend on it for large-scale or fully automated contact creation.

Prerequisites

  • Your Salesforce org must be connected as a data source in Glean, and an admin must enable the Salesforce action pack and complete Salesforce Actions Setup including OAuth configuration.
  • Users must authenticate for Salesforce actions on first use and have permission to create Contact records.

Supported parameters

ParametersTypeDescription
Account IDStringUnique identifier for the account.
BirthdateStringBirthdate of the individual.
DepartmentStringDepartment the individual belongs to.
DescriptionStringAdditional details or notes about the record.
EmailStringPrimary email address.
First nameStringFirst name of the individual.
Last nameStringRequired. Last name of the individual.
Lead sourceStringSource from which the lead was acquired.
Mailing cityStringCity for the mailing address.
Mailing countryStringCountry for the mailing address.
Mailing postal codeStringPostal or ZIP code for the mailing address.
Mailing stateStringState or province for the mailing address.
Mailing streetStringStreet address for mailing.
Mobile phoneStringMobile phone number.
PhoneStringPrimary phone number.
TitleStringJob title or role of the individual.

Usage example

You need to add a new contact to Salesforce for a customer representative you met at a conference, checking first to avoid creating a duplicate if they already exist in your system. Instruction to an agent: “Check if a contact exists in Salesforce for [email protected]. If not found, create a new contact for ABC JIM, Director of Product at XYZ Solutions, phone 123-555-0789, located in Palo Alto, CA, and associate her with the YXZ account.” Resulting behavior:
  • Calls a Salesforce search action to find contacts with email “[email protected]”.
  • No existing contact found, so proceeds with creation.
  • Calls Search Salesforce with SOQL to find the Account ID for “XYZ Solutions”.
  • Retrieves the Account ID (for example, “001xx000001234567”).
  • Calls Create contact with:
    • First name set to “ABC”.
    • Last name set to “JIM” (required).
    • Email set to “[email protected]”.
    • Title set to “Director of Product”.
    • Phone set to “123-555-0789”.
    • Account ID set to “001xx000001234567”.
    • Mailing city set to “Palo Alto”.
    • Mailing state set to “CA”.
    • Mailing country set to “United States”.
  • Creates a new Contact record in Salesforce linked to the XYZ Solutions account.
  • Returns the Contact ID (for example, “003xx000001234567”).
  • Confirms the contact was created and associated with the correct account.
Workflow tip: Always search for existing contacts by email before creating to avoid duplicates. Combine this action with Salesforce Add contact to campaign, Salesforce Associate contact to account, or Salesforce Send email to build complete contact management workflows. For bulk operations, process contacts from structured sources like Google Sheets by iterating through rows.

Troubleshooting

  • Possible cause: The Salesforce action pack is not added or published in your Glean deployment.
  • Fix: In the Glean admin console, go to Platform → Actions, add the Salesforce action pack if it is not present already, link it to your Salesforce datasource instance, configure authentication, update publish settings, and save. After that, Salesforce Create contact must appear under Actions → By datasource → Salesforce in the agent builder.
  • Possible cause: The Salesforce OAuth app is not configured correctly (callback URL, Consumer Key, or Consumer Secret), or the user running the agent has not completed the required Salesforce authorization flow from Glean.
  • Fix: Have the user retry the agent and complete the Salesforce auth prompt. If errors persist, a Glean admin must re-check the OAuth setup on the Salesforce Actions Setup page and re-run the configuration steps.
  • Possible cause: The prompts and field mappings of the agent into the Salesforce Create contact action do not match your Salesforce org’s schema or defaulting rules, for example, default contact owner or required custom fields.
  • Fix: Review how your agent prompts and maps values into the Salesforce Create contact action, and confirm that your Salesforce org’s defaults, required fields, and validation rules align with how the agent is creating contacts. Update either the agent configuration or your Salesforce configuration so they match.

FAQs

No. This action always attempts to create a new contact. It does not check for existing contacts or update them. To avoid duplicates, design your agent to search for existing contacts, for example, by email address before calling Salesforce Create contact, and branch accordingly.
Yes. You can combine Salesforce Create contact with other Salesforce actions such as Salesforce Search, Search Salesforce with SOQL, Salesforce Add contact to campaign, Salesforce Associate contact to account, Salesforce Send email, and Salesforce Log email activity in the same agent so the flow can look up records, create new contacts, send follow-up emails, and log activity in a coordinated way.
The action must comply with your Salesforce org’s required fields, validation rules, and defaulting behavior. If the agent omits required fields or passes values that conflict with validation rules, Salesforce will reject the request and the action will fail. Check the agent run details and Salesforce error messages to identify missing fields.