Step 3: Adding a new External Data Source to Salesforce
On your Salesforce Lightning dashboard, access “Setup” in the top toolbar.
Either enter “External Data Source” in the Quickfind bar, or navigate Data > External Data Sources in the sidebar under the “Administration” header. Then click the “New External Data Source” button.
In the form, fill out the following fields:
- External Data Source: give this a name to refer to the data set that you are adding a view for.
- Type: Salesforce Connect: OData 4.0 (Please note that 2.0 is not supported by Namara)
- URL: paste the API Endpoint url that you copied from before, then add “OData.svc/” to the end, so that it looks like this:
- Identity Type: Per User
- Authentication Protocol: Password Authentication
- Administration Username: Set this to whatever you want. This field will not be used for verification and will be ignored.
- Administration Password: Paste your API Key here.
The form should look like this:
Now click “Save”. You will be taken to a screen to review the details. If you are satisfied, click “Validate and Sync”.
Salesforce will access a specific metadata endpoint for this data set and model the external data as Salesforce objects. If successful, you will be shown a table of all External objects found. Only the table named “Data” is necessary for viewing. After selecting that, click “Sync”.
If you go back to the Setup sidebar and view your “External Data Objects”, you should see one called Data. DataSets and Versions only store metadata and aren’t required for viewing. You can edit this object to enable reporting. I recommend changing the label to something more descriptive like “HamiltonSchool”, but do not change Object Name.
Click “Save” when you are finished.
Step 4: Grant User Permissions for Viewing
In the sidebar, navigate to “Profiles” and find the profiles of whatever user will be accessing this data. Click “Edit” for the profile and ensure that External Object Permissions are set for this external source.
Then under Enabled External Data Source Access, click “Edit” and grant access for your external data source.
Next you need to store the access credentials for this data set so that the API Key can be used on subsequent access calls. To do this, click on your user icon in the Top Right corner and then click “Settings”. You will be taken to another page with a Sidebar & Quickfind text field. Click on the tab labelled “Authentication Settings For External Systems” and then click “New”.
Fill out the form with access credentials for a user.
Step 5: Create a Tab
In your Sidebar Quickfind, search for “Tabs”, then create a new Custom Object tab. Select the External Object by the label that you added in Step 3 and add an icon style. Click “Next”. Set visibility for Tabs however you would like.
Step 6: Create a View
Navigate to the tab that you created in Step 5. When you click “Go!” you’ll notice that these aren’t the fields you are looking for.
NOTE: We do not give API-level access to a single row in a data set, so accessing Display URL will give you an error.
Create New View
You will have to create a new View and use $filters and $select statements in order to pull out the data. Start by clicking the “Create New View” button.
Create whatever query you would like on the data. Here, I am trying to view all high schools with enrolment over 500.
When selecting fields to display, ignore _row_id — it’s just a unique key we use so that the OData adapter can tell records apart.
Since there are a maximum 15 fields for a view, it’s more manageable to create several meaningful views rather than a single one that attempts to read the entire data set.
Now when you click “Go!” you will see the fields from your view, and be able to step through the paginated results.