Skip to content

Note

This flow is self-documenting and should be viewed within Salesforce (Setup > Process Automations > Flows). This document is to support working through a visual flow. Please note: the flow commentary is produced using AI.

Overview#

Flow name: MoveData_Donation_Helper_Get_Account_ID Label: [MoveData] Donation: Helper - Get Account ID Type: Auto-Launched Flow Template API version: 60.0 Status: Active

This utility flow determines and returns account IDs using a hierarchical lookup strategy.

Purpose#

The flow provides account ID resolution that:

  • Retrieves account IDs from multiple data sources with priority hierarchy
  • Handles missing account data gracefully with fallback mechanisms

Salesforce fields#

This flow interacts with the Salesforce Account and Contact objects and their related fields. Below is a mapping of all fields utilised:

Object Field API name Field type Purpose in flow
Account Id ID Primary account identifier
Contact Id ID Contact record identifier
Contact AccountId Lookup to Account Links contact to associated account

Input variables#

Variable Type Required Description
DonorAccount Account SObject No Direct account object (if available)
DonorContact Contact SObject No Contact object with potential account relationship

Output variables#

Variable Type Description
Result String Resolved account ID
DonorAccount Account SObject Updated account object with resolved ID
DonorContact Contact SObject Contact object (passed through)

Flow logic#

1. Account availability check#

The flow first determines the primary data source:

Account priority assessment:

  • If DonorAccount exists: Uses direct account ID extraction
  • If DonorAccount is null: Proceeds to contact-based account resolution

2. Direct account ID extraction#

When DonorAccount is available:

Direct ID assignment:

  • Extracts DonorAccount.Id directly
  • Assigns to Result variable
  • Proceeds to account object update

3. Contact-based account resolution#

When DonorAccount is missing, uses contact data:

Contact account ID check:

  • Contact exists AND AccountId is set AND AccountId is not null: Uses DonorContact.AccountId
  • Contact missing OR AccountId not set OR AccountId is null: Performs database lookup

4. Database account lookup#

When contact exists but AccountId is not readily available:

Contact lookup operation:

  • Queries Contact object using DonorContact.Id
  • Retrieves AccountId field from database
  • Handles null values if no account relationship exists
  • Assigns result to Result variable

5. Account object update#

Final step for all resolution paths:

ID assignment:

  • Sets DonorAccount.Id to the resolved account ID
  • Ensures account object contains proper ID reference
  • Supports downstream processing requirements

Lookup hierarchy#

The flow follows a clear priority hierarchy for account ID resolution:

  1. Direct account ID: DonorAccount.Id (highest priority)
  2. Contact account ID: DonorContact.AccountId (if readily available)
  3. Database lookup: Query Contact.AccountId (fallback option)
  4. Null result: No account relationship found

Dependencies#

None

Ask MoveData AI
Ask about setup, configuration, or troubleshooting
How can I help you with MoveData today?