# How does Salesforce Connect utilize OData adapters to integrate external data without storing it locally?

**Topic:** Integration · **Difficulty:** Medium · **Tags:** Integration, Salesforce Connect, OData Adapters

Read it on the site: https://www.forcechallenges.com/interview-questions/how-does-salesforce-connect-utilize-odata-adapters-to-integrate-external-data-without-storing-it-locally

## Answer

**Basics:** This is **data virtualization**. Rather than syncing records into Salesforce (using storage and risking staleness), Salesforce makes a live call to the external system whenever a user opens a list, a record or a report. External Objects have API names ending in `__x` and behave like custom objects in tabs, page layouts, related lists, SOQL and global search. It is a separately licensed feature (verify licensing per edition).

**How it works:**
1. Expose the source as an OData service (or use another adapter: Cross-Org, Amazon Athena, or a custom Apex adapter).
2. Create an **External Data Source** (Setup > External Data Sources), choose the adapter type, endpoint and identity type (named principal or per user); use a Named Credential/External Credential for auth.
3. Click **Validate and Sync** to create External Objects from the service metadata.
4. Grant permissions and add the objects to tabs or related lists.
5. Each user action triggers an OData request; Salesforce translates the SOQL query into `$filter`, `$top`, `$select`, and maps the response to rows.

**Advanced / deep dive:** Relationships use special lookups: **External Lookup** (child external to parent standard), **Indirect Lookup** (external child to standard parent using an external ID), plus standard lookups. Because every access is a callout, performance depends on the source and network; queries with non-pushdown-able filters can be slow; limits on callouts, row counts and timeouts apply. External objects do not support all features (for example, some reporting and sharing features, and many automation features are limited, verify in docs). Writable external objects can create, update and delete in the source. Alternatives: replicate via ETL if you need offline access, heavy reporting or joins; use Data Cloud data virtualization/zero-copy for analytics scenarios. The custom Apex adapter framework (`DataSource.Connection` and `DataSource.Provider`) fits non-OData systems.

**Code / config example:** SOQL on an external object:
```sql
SELECT ExternalId, OrderNumber__c, Status__c FROM Order_Ext__x WHERE Status__c = 'Open' LIMIT 50
```

**Hidden gotchas & must-remember points:**
- It is real time, so source downtime breaks the UI.
- Not every SOQL clause pushes down; avoid large unfiltered scans.
- External object records do not count toward data storage but callouts count toward limits.
- The `ExternalId` and `DisplayUrl` fields are standard.
- Security: with a named principal, all users see what that credential sees; use per-user auth or sharing design to avoid exposure.
- Reports and some search features are limited.

**Best practice:** Use Salesforce Connect for large, rarely changing reference data and low-latency sources; replicate when you need heavy reporting, automation or offline access.

---
Source: ForceChallenges · last updated 2026-11-02
