Now inviting automation leaders: publish your playbook as a skill, under your own name. Publish yours →
Automation Skills
All skills/Sf industry commoncore datamapper/Best-practices
Reference · Sf industry commoncore datamapper

Best-practices

Part of Sf industry commoncore datamapper. Install the skill and your agent reads this page when it needs the depth.

<!-- Parent: sf-industry-commoncore-datamapper/SKILL.md -->

Data Mapper Best Practices

When to Use Each Type

Extract

Use Extract when:

Do NOT use Extract when:

Turbo Extract

Use Turbo Extract when:

Do NOT use Turbo Extract when:

Transform

Use Transform when:

Do NOT use Transform when:

Load

Use Load when:

Do NOT use Load when:


Field Mapping Patterns

Explicit Field Selection

Always specify fields explicitly. Never rely on wildcard or "all fields" selection.

Good:  Account.Name, Account.Industry, Account.BillingCity
Bad:   Account.* (extracts all fields, wastes bandwidth and heap)

Input/Output Path Structure

Data Mapper fields use dot-notation paths for input and output:

Input Path:   AccountData.Name
Output Path:  Account.Name

For nested structures:

Input Path:   Response.data.accounts[0].name
Output Path:  AccountList.Name

Type Conversion Handling

Map fields with compatible types. Common conversions:

Source Type Target Type Notes
String Date Requires ISO 8601 format (YYYY-MM-DD)
String Number Ensure source contains numeric values only
Boolean String Maps to "true"/"false" string literals
DateTime Date Truncates time component
Picklist String Maps selected value as string

Lookup Resolution for Load

When loading records with lookup relationships:

  1. Define a lookup mapping that resolves the external key to a Salesforce ID
  2. Specify the lookup object and match field (e.g., Account.Name to resolve AccountId)
  3. Handle cases where the lookup returns no match (set default or fail gracefully)
Field:         AccountId
Lookup Object: Account
Match Field:   Name
Input Path:    InputData.AccountName

Query Sequence Optimization

Filter Field Indexing

For Extract and Turbo Extract, filter on indexed fields whenever possible:

Filter Order

Place the most selective filter first to reduce the result set early:

Good:  WHERE Id = :recordId AND Status = 'Active'
Bad:   WHERE Status = 'Active' AND Id = :recordId

Relationship Query Depth

Limit relationship traversal to 2 levels for performance:

Good:  Account.Owner.Name (1 level)
Bad:   Account.Parent.Parent.Parent.Owner.Name (3+ levels)

Limit and Offset

Always set a LIMIT on Extract queries unless the consuming component guarantees a bounded input:

LIMIT 200    -- Standard batch size
LIMIT 2000   -- Maximum for most UI scenarios
LIMIT 10000  -- Absolute maximum, use only with pagination

Null Handling and Type Conversion

Default Values

Set default values for fields that may be null to prevent downstream errors:

Field Type Recommended Default Rationale
String "" (empty string) Prevents null reference in concatenation
Number 0 Prevents null arithmetic errors
Boolean false Prevents null conditional evaluation
Date (no default) Leave null; do not fabricate dates
Lookup (no default) Leave null; handle in consuming component

Null-Safe Mapping

When mapping fields that may be null:

  1. Set isNullable: true on the OmniDataTransformItem
  2. Configure a default value where business logic requires one
  3. Document which fields are expected to be null in certain scenarios
  4. Test with records that have null values in mapped fields

Relationship Queries

Parent-to-Child (Subquery)

Extract supports parent-to-child relationship queries:

Object: Account
Fields: Name, Industry
Child Relationship: Contacts (Contact)
Child Fields: FirstName, LastName, Email

Output structure:

{
  "Name": "Acme Corp",
  "Industry": "Technology",
  "Contacts": [
    { "FirstName": "Jane", "LastName": "Doe", "Email": "jane@acme.com" }
  ]
}

Child-to-Parent (Lookup Traversal)

Extract supports child-to-parent traversal via dot notation:

Object: Contact
Fields: FirstName, LastName, Account.Name, Account.Industry

Output structure:

{
  "FirstName": "Jane",
  "LastName": "Doe",
  "AccountName": "Acme Corp",
  "AccountIndustry": "Technology"
}

Turbo Extract Limitations

Turbo Extract does NOT support:


Performance with Large Data Volumes

Batch Size Recommendations

Record Count Recommended Approach
1-200 Standard Extract, single call
200-2000 Turbo Extract, single call
2000-10000 Turbo Extract with pagination via Integration Procedure
10000+ Batch processing: scheduled Integration Procedure with chunked Turbo Extract calls

Heap Size Management

Each Data Mapper execution contributes to the Apex heap limit (6 MB synchronous, 12 MB async):

Caching Strategy

For data that changes infrequently:

Monitoring

Track Data Mapper performance using:

sf data query -q "SELECT Id,Name,Type,LastModifiedDate FROM OmniDataTransform WHERE IsActive=true ORDER BY LastModifiedDate DESC" -o <org>

Review execution logs in OmniStudio Designer > Data Mapper > Preview to identify slow queries and excessive field counts.

Publish your skill

Copy this prompt into Claude Code, Codex or any agent. It walks you through your first skill in about 20 minutes, with you as the author.

Click to copy.