Skip to main content

Accessing External Data from

·4 mins

You can do cool stuff using “External Objects” in - namely, access the data from application through yet another tab.

If you think that is cool, this post is indeed for you. If not, you can always read this through and get something to scoff at.

But first -

Why external objects or data sources are important? #

Well, you cannot have all the data in this world residing in your or database. Regardless of how great is, it will be sometime before consolidating all your business applications on that platform. And even after doing that, you might have that one weird data source refusing to be complaint.

Data external to a system was a reality a decade back, and will continue to be relevant in the future. The only thing that will change is how easy and seamless will be the interaction between the systems.

This is where external object capability on steps in.

External Objects in #

You will use external objects to source data from external systems and display the data in a tab. The data is temporarily stored within database, but it will remain the sole property of the data supplier.

You can do the following data operations through External Objects -

  • Access data through UI and APIs
  • Access data from SOSL and SOQL (no aggregation possible)

You will not be able to do any analytics on the external data.

Configure External Data Objects #

Since we are now experto-papyrus (experts on paper) on the theory of External Data access from, it is time to see it in action.

To test the functionality we will use the NorthWind (remember that?) database that is publicly available to all and sundry on .

Prerequisites #

  • To get that data, you need the source system to be accessible via the internet or from application. If you are behind a firewall just make sure queries are allowed through.
  • External data source should support the authentication that can use.
  • Supported formats are Atom and JSON, so don’t expect to do miracles with any other data format.

I ran through this quick check list and can see that our favourite NorthWind database on satisfies each of the criteria.

Create External Data Source  #

As a first step, we create the data source that will be used by our External Object.

Navigate to Develop | External Data Sources.

External data source in

Create a new entry and fill in required information.

create new data source for external objects in

We select the format as AtomPub since that is what is supported by our NorthWind data source on

Hit save, and in the subsequent screen click on “Validate and Sync” button.

validate and sync external data source in

Since we want to sync everything available in North Wind, we just select all data fields available. If the data source changes in the future, you can always go back to the External Data Source in and hit “Sync” button again to get those changes to

You will see that this simple action of clicking the “Sync” button brings the structure of data sources in external system to

Create External Object #

Navigate to Develop | External Objects. You will see that the objects have been automatically created because of your previous action.

external objects in

You can edit these External Objects just like regular objects, and make any changes as necessary.

sfdc create external objects

The wizard not only creates the data model within the application, but also the UI. You can either customize the pages, or add custom tabs based on the external objects.

The tab shows the external data right within the application. You may need to refresh the view the first time around though. external objects UI

Note that the external data will not have a id, but only the external id. The URL takes you the actual data supplied by the source system. Drill down on the external id to view the details sourced into application.

sfdc external data objects

What is the use of External Objects? #

You can use External Objects to show transient data from third party sources into application.

The data is only temporarily stored within application, and that coupled with the fact that you cannot update the data, will limit the kind of use that you can put this to.

But you could use this these objects to show contextual information for salesforce objects, and quickly provide access to the details. Be wary of performance implications though.