Forms to Salesforce Connector Icon

Forms to Salesforce Connector

Seamlessly connect your Statamic forms to Salesforce - Automatically create Leads, Contacts, and other Salesforce objects from form submissions with advanced field mapping and comprehensive error handling.

πŸ”— Related Connectors

This connector is part of the Forms To Wherever ecosystem. Check out our other connectors:

Features

  • Multiple object support - Create Leads, Contacts, Accounts, Opportunities, or Cases
  • Custom field mapping to any Salesforce object field
  • Lead source tracking - Automatically set lead sources for attribution
  • Required field handling - Intelligent defaults for required Salesforce fields
  • OAuth refresh token support for longer-lived Salesforce integrations
  • Comprehensive error handling with detailed logging

This addon does:

  • This
  • And this
  • And even this

How to Install

You can search for this addon in the Tools > Addons section of the Statamic control panel and click install, or run the following command from your project root:

composer require stokoe/forms-to-salesforce-connector

How to Use

  1. Edit your form in the Statamic Control Panel
  2. Navigate to the "Form Connectors" section
  3. Enable the Salesforce connector
  4. Choose one of these auth setups:
    • Simple: enter your Salesforce instance URL and access token
    • Recommended: enter your Salesforce instance URL, client ID, client secret, refresh token, and login URL for automatic token refresh
  5. Select the object type (Lead, Contact, etc.)
  6. Configure field mappings as needed
  7. Save and test!

Salesforce Authentication

The connector supports two authentication approaches:

1. Static access token

Useful for quick tests, but the token will expire and need updating manually.

2. OAuth refresh token (recommended)

Provide these values from your Salesforce connected app:

  • Instance URL
  • Client ID
  • Client Secret
  • Refresh Token
  • Login URL (https://login.salesforce.com for production or https://test.salesforce.com for sandboxes)

When configured, the connector will request a fresh access token automatically before sending data, and retry once if the existing token has expired.

Conditional Field Mapping

You can map multiple form fields to the same Salesforce field to support conditional forms. For example, if you have separate service type fields that show based on a category selection:

Form Field Salesforce Field
residential_service Service_Type__c
commercial_service Service_Type__c
retirement_service Service_Type__c

The connector will use the first non-empty value, ignoring null/empty fields.

Requirements

  • PHP 8.2+ (8.3+ for Statamic 6)
  • Statamic 4.0+ | 5.0+ | 6.0+
  • Forms To Wherever base package