Skip to main content
Salesforce Object: Account
WeGive Models:
  • Donor (type: company)
  • Household (type: family)

How Account Data Syncs

This table shows all fields that sync between WeGive and Salesforce for company/organization donors and household accounts. Direction:
  • Import from Salesforce - Data imports from Salesforce into WeGive only
  • Export to Salesforce - Data exports from WeGive to Salesforce only
  • Both Ways - Data syncs in both directions
Mapping Types:
  • Configurable - Can be customized via integration settings
  • Hard-coded - Built into the integration logic and cannot be changed

Account Types in NPSP

In Salesforce NPSP, the Account object is used for two distinct purposes, differentiated by Record Type:
  1. Organization Accounts - Companies and organizational donors (non-household)
  2. Household Accounts - Family/household groupings of individual contacts
The integration handles both types through the Account object, using Record Types to distinguish between them.

Sync Triggers

From WeGive to Salesforce (Export)

Account data is exported from WeGive to Salesforce when:
  • Account Created: A new company donor or household is created in WeGive
  • Account Updated: An existing company donor or household is modified in WeGive (e.g., name changed, phone number updated, address modified)
The export happens automatically after the create or update action in WeGive.

From Salesforce to WeGive (Import)

Account data is imported from Salesforce to WeGive based on:
  • Last Modified Date: WeGive periodically polls Salesforce for Accounts that have been modified since the last sync
  • Sync Frequency: The integration checks for updated Accounts on a scheduled basis (frequency varies by integration configuration)
  • Modified Field Tracking: Only Accounts with a LastModifiedDate newer than the last successful sync are pulled into WeGive
  • Record Type Filtering: The integration separates Household Accounts from Organization Accounts based on Record Type
This means:
  • Creating a new Account in Salesforce (either type) will import it to WeGive on the next sync cycle
  • Updating an existing Account in Salesforce will trigger an import to WeGive on the next sync cycle
  • The sync is based on Salesforce’s LastModifiedDate field, not individual field changes

Sync Process Overview

Account-Level Synchronization

WeGive syncs company/organization donors and households at the Account level in Salesforce, maintaining proper organizational relationships and hierarchies. This includes company information, household groupings, contact relationships, and address details. The integration handles both standalone organization accounts and those with primary contact relationships.

Pulling Data from Salesforce

When pulling data from Salesforce, WeGive queries Accounts based on the last modified date, Record Type, and any specific filtering criteria. The integration pulls comprehensive data from the Account record, including all standard and custom fields that have been mapped. For Organization Accounts:
  • Creates or updates the corresponding WeGive company Donor record
  • Maintains relationships to primary contacts
  • Handles organizational address information
For Household Accounts:
  • Creates or updates the corresponding WeGive Household record
  • Links all household members (Contacts associated with the Account)
  • Identifies and sets the primary household member via the npe01__One2OneContact__c field
The import process includes special handling for the primary contact relationship (via the npe01__One2OneContact__c or configurable primary contact column), ensuring that organizational contacts and household members are properly linked.

Pushing Data to Salesforce

When a company Donor or Household record is created or updated in WeGive, the integration compiles a payload for the Salesforce Account object. This payload includes all mapped fields and ensures that the Account record is properly created or updated in Salesforce. The integration handles complex logic including:
  • Type Assignment: Automatically sets the Type field to “Organization” for companies (households don’t set this field)
  • Record Type Assignment: Assigns the appropriate Record Type based on whether it’s a company or household
    • Companies: Uses non_household_record_type_name setting (default: “Organization”)
    • Households: Uses household_record_type_name setting (default: “Household Account”)
  • Primary Contact Linking: Can establish primary contact relationships via the npe01__One2OneContact__c field (create only)
NPSP Standard Data and Relationship Handling: When creating a new Account from WeGive, the integration follows NPSP standard data handling:
  • For Companies: The Type field is automatically set to “Organization” to distinguish it from Household accounts
  • For Households: The Type field is not set (households typically don’t have a Type value)
  • The appropriate Record Type is assigned based on your integration settings
  • Primary contact relationships can be established via the npe01__One2OneContact__c field (create only)

Standard Field Mappings

Salesforce FieldWeGive FieldWeGive API FieldDirectionTypeNotes
IdSalesforce Account IDsalesforce_account_idImport from SalesforceHard-codedSalesforce’s unique identifier for this account
NameCompany NamenameBoth WaysConfigurable import
Hard-coded export
TypeOrganization TypeStatic: ‘Organization’Export to SalesforceHard-codedAlways set to ‘Organization’ to distinguish from Household accounts
RecordTypeIdRecord TypeDynamicExport to SalesforceHard-codedQueried from RecordType based on non_household_record_type_name setting
npe01__One2OneContact__cPrimary Contact Salesforce IDsalesforce_contact_idBoth WaysConfigurableCreate only; links to primary contact
primaryContactColumnPrimary Donor IDprimary_donor_idImport from SalesforceHard-codedMaps to WeGive donor record
PhoneOffice Phoneoffice_phoneBoth WaysConfigurable import
Hard-coded export
FaxFaxfaxBoth WaysConfigurable import
Hard-coded export
BillingStreetBilling Address - Streetbilling_address.address_1Both WaysConfigurable
BillingCityBilling Address - Citybilling_address.cityBoth WaysConfigurable
BillingStateBilling Address - Statebilling_address.stateBoth WaysConfigurable
BillingPostalCodeBilling Address - Zip Codebilling_address.zipBoth WaysConfigurable
BillingCountryBilling Address - Countrybilling_address.countryBoth WaysConfigurable
ShippingStreetMailing Address - Streetmailing_address.address_1Both WaysConfigurable
ShippingCityMailing Address - Citymailing_address.cityBoth WaysConfigurable
ShippingStateMailing Address - Statemailing_address.stateBoth WaysConfigurable
ShippingPostalCodeMailing Address - Zip Codemailing_address.zipBoth WaysConfigurable
ShippingCountryMailing Address - Countrymailing_address.countryBoth WaysConfigurable

Complete Field Mapping - Household

Salesforce FieldWeGive FieldWeGive API FieldDirectionTypeNotes
IdSalesforce IDsalesforce_idImport from SalesforceHard-codedSalesforce’s unique identifier for this household account
NameHousehold NamenameBoth WaysConfigurable import<br>Hard-coded export
RecordTypeIdRecord TypeDynamicImport from SalesforceHard-codedQueried from RecordType based on household_record_type_name setting
npe01__One2OneContact__cPrimary Contact Salesforce IDsalesforce_contact_idBoth WaysConfigurable import<br>Hard-coded exportLinks to primary household member
primaryContactColumnPrimary Contact Salesforce IDsalesforce_contact_idImport from SalesforceHard-codedConfigurable field name; maps to primary household member
wegive__WeGive_Id__cWeGive Household IDidExport to SalesforceHard-codedWeGive’s unique identifier for this household

Important Notes

Record Type Assignment

The integration automatically assigns the appropriate Record Type based on whether the Account represents a company or a household: For Companies:
  • Record Type is determined by the non_household_record_type_name setting (default: “Organization”)
  • The Type field is automatically set to “Organization”
For Households:
  • Record Type is determined by the household_record_type_name setting (default: “Household Account”)
  • The Type field is NOT set (households typically don’t have a Type value)
This ensures proper categorization and NPSP functionality for each account type.

Primary Contact Linking

For Companies: The npe01__One2OneContact__c field links the Account to a primary Contact in Salesforce. This field is only set during account creation and follows the NPSP model for organization contacts. After creation, this relationship cannot be changed via the integration. Primary Contact Behavior on Create:
  • When creating an Account in Salesforce, if the company donor in WeGive has an associated user (logged in previously), the integration will:
    1. Find the primary individual donor linked to that user
    2. Set npe01__One2OneContact__c to that individual’s Salesforce Contact ID
    3. Copy the primary individual’s email addresses to the company donor record
For Households: The npe01__One2OneContact__c field identifies the primary member of the household. On import:
  • WeGive finds the Contact whose salesforce_id matches the value in npe01__One2OneContact__c
  • That Contact is marked as the primary household member in WeGive
  • All other Contacts with the same AccountId are added as household members
On export:
  • WeGive sets npe01__One2OneContact__c to the Salesforce ID of the primary household member

Household Member Management

On Import (Salesforce → WeGive):
  1. The integration queries for all Contacts where AccountId matches the Household Account’s Salesforce ID
  2. All matching Contacts are added as members of the Household in WeGive
  3. The Contact referenced in npe01__One2OneContact__c is set as the primary member
On Export (WeGive → Salesforce):
  1. When a Household is created in WeGive with members, the integration first pushes all member Contacts to Salesforce
  2. The Household is then created as an Account with the appropriate Household Record Type
  3. The npe01__One2OneContact__c field is set to reference the primary member
Automatic Household Creation: When a Contact is created in Salesforce without an AccountId, NPSP will automatically create a Household Account for that Contact. On the next import cycle:
  • WeGive will import the newly created Household Account
  • The Contact will be linked to this Household in WeGive
  • If no Household previously existed in WeGive, one will be created

Address Handling

Unlike Contact records, Account address state and country fields sync in both directions. This is because Accounts typically don’t have the same picklist validation constraints as Contacts, and organizational addresses often need full bi-directional syncing. Note: Account uses different address field names than Contact:
  • Billing Address on Account = Primary business address
  • Shipping Address on Account = Secondary/mailing address
This differs from Contact, which uses:
  • Mailing Address on Contact = Primary address
  • Other Address on Contact = Secondary/billing address
Household Addresses: Households typically don’t sync address information at the Account level in this integration. Address information is maintained at the Contact (household member) level.

Email Inheritance from Primary Contact (Companies Only)

When a company donor is created in Salesforce and has a primary contact (via user login relationship), the integration automatically copies email addresses from the primary individual donor to the company donor:
  • Company email_1 ← Primary Contact email_1
  • Company email_2 ← Primary Contact email_2
  • Company email_3 ← Primary Contact email_3
This ensures the organization has contact information even though email fields are not standard on the Account object. Note: This does not apply to Households, as household contact information is maintained through the household members’ Contact records.

Required Fields

For Companies:
  • Name is required in Salesforce. The company name from WeGive is always sent to Salesforce.
For Households:
  • Name is required in Salesforce. The household name from WeGive is always sent to Salesforce.
  • Household names are typically formatted as “[Primary Member Last Name] Household” but can be customized

Understanding Configurable vs Hard-coded

  • Configurable mappings can be customized through integration settings if needed for your organization’s specific field setup
  • Hard-coded mappings are built into the integration’s core logic and handle special business rules (like automatic Type assignment and RecordType selection)

Account Matching & Create/Update Logic

For Companies

When WeGive exports a company donor to Salesforce, the integration uses the following logic to determine whether to create a new Account or update an existing one:

Step 1: Check for Existing Salesforce Account ID

The integration first checks if the WeGive company donor already has a salesforce_account_id stored:
  • If Salesforce Account ID exists: The integration will UPDATE the existing Account record in Salesforce using this ID
  • If no Salesforce Account ID exists: The integration proceeds to Step 2

Step 2: Search by Company Name and Email

If there’s no Salesforce Account ID, the integration searches Salesforce for an existing Account with a matching company name:
  • If NO name match found: The integration creates a NEW Account in Salesforce
  • If name match IS found: The integration proceeds to Step 3 to verify availability
Email Matching (Secondary Check): If no match is found by name but the company donor has an email_1, the integration also searches for Accounts where a related Contact has that email address.

Step 3: Verify Account Availability

If a Salesforce Account is found by name (or email), the integration checks whether that Account is already connected to a different WeGive company donor:
  • If the Account is available (not connected to another WeGive company donor):
    • The integration LINKS this WeGive company donor to the existing Salesforce Account
    • Updates the Account with the company donor’s information
    • Stores the Salesforce Account ID in WeGive for future syncs
  • If the Account is already connected to another WeGive company donor:
    • The integration creates a NEW Account in Salesforce to avoid conflicts
    • This prevents two WeGive company donors from being mapped to the same Salesforce Account record

Special Behavior on Account Creation

When a new Account is created in Salesforce:
  1. Primary Individual Linking: If the company donor has an associated user account (someone who has logged in), the integration will:
    • Find the most recent individual donor login for that user
    • Set that individual donor’s salesforce_account_id to match the newly created Account
    • This links the primary contact to the organization
  2. Salesforce Account ID Retrieval: After the Account is created, Salesforce returns the AccountId to ensure proper linking

For Households

When WeGive exports a household to Salesforce, the integration uses the following logic:

Step 1: Check for Existing Salesforce Household ID

The integration first checks if the WeGive household already has a salesforce_id stored:
  • If Salesforce ID exists: The integration will UPDATE the existing Household Account record in Salesforce using this ID
  • If no Salesforce ID exists: The integration creates a NEW Household Account in Salesforce
Note: Unlike companies and contacts, households are NOT matched by name or other attributes. They are only matched by stored Salesforce ID to prevent incorrect household merging.

Step 2: Automatic Linking on Contact Import

When importing Contacts from Salesforce, if a Contact has an AccountId that links to a Household Record Type Account:
  1. WeGive checks if a Household with that salesforce_id already exists
  2. If it exists, the Contact is added as a member to that Household
  3. If it doesn’t exist, a new Household is created in WeGive with that salesforce_id
This ensures that Salesforce-created households are properly represented in WeGive.

Why This Matters

This matching logic ensures:
  • For Companies:
    • Each WeGive company donor maps to exactly one Salesforce Account
    • Existing Salesforce Accounts are reused when appropriate (matching by name or email)
    • Multiple WeGive company donors don’t accidentally share the same Salesforce Account record
    • Primary contacts are automatically linked to their organizations
  • For Households:
    • Each WeGive household maps to exactly one Salesforce Household Account
    • Household membership is properly maintained across both systems
    • Primary household members are correctly identified
    • Households created in Salesforce are automatically imported and linked to their members in WeGive