This is a common case when a customer wants you to integrate some system with Salesforce so that external data is displayed in Salesforce preferably the way the customer sees it with other Salesforce objects (layout, tab, list view, chatter, lookups to related records, reporting) and the customer (or you) is concerned about data storage. And in this case, you can suggest different approaches that have their own pros and cons.
A Brief Overview
1. You can use any ETL tool to copy data from one system to Salesforce and update it back from Salesforce to another system. However, you have the same set of info that consumes data storage in Salesforce (of course except for some standard objects that don’t consume data storage).
2. You can use the AppExchange package to connect the specified system and it’s already configured. However, there are no AppExchange packages for every external system, or it can be quite expensive.
3. You can collaborate with a team that is responsible for the particular external system and provide them at least the info about the standard Salesforce API to push information. However, not always you can collaborate with such a team.
4. You can develop some scheduler to retrieve information from the external system that won’t be real-time and will anyway consume Salesforce data storage.
In case the Salesforce data storage really matters in your integration goals, you need a real-time synchronization of information between external systems and Salesforce, and you don’t want to consume data storage, External Data Source with External Objects can help you with it.
However, not every system supports OData protocol by default, but it can have a REST API to handle CRUD operations.
Don’t forget to check out: What are External Data Sources? | All You Need to Know
In this case you can implement a custom apex adapter.
You can read consideration related to custom apex adapter here.
In our use case we are going to integrate Toggl Track for time tracking with Salesforce in order to see Time Entries.
It has a REST API doc.
Steps to Show and Update External Data in Salesforce
- Configure Named Credential: There are several ways according to the Toggl doc, we are going to use API Token. Get your API Token under your profile in Toggl.
- Your Auth with ApiToken according to the doc should contain ApiTokenValue:api_token_keyword
- Hence it’s necessary to configure params in the Named Credentials. Let’s configure it.
- Create External Credential with a Custom auth.protocol.
- Define and configure the principals (in our case will be Admin).
-
- For 1, in our case we have only 1 auth user.
- For 2, add param.
- For 3, 4 – one of the param is the ApiTokenKeyword name and value will be “api_token” according to Toggl doc.
- For 5, 6 – another param is the ApiTokenValue name and value will be generated by the Api Token from the Toggl system (example: 1971800d4d82861d8f2c1651fea4d212).
- Now, configure header to reflect the way how Toggl accepts it:
Check out another amazing blog here by Vimera: The Benefits of Using Salesforce Nonprofit Cloud
- {!’Basic ‘ & BASE64ENCODE(BLOB($Credential.TogglExtCred.ApiTokenValue & ‘:’ & $Credential.TogglExtCred.ApiTokenKeyword))}
- After that configure named credential.
- And finally create a permission set to grant access to your named credential and a user that is going to use it.
This article is prepared by our Salesforce Architect Anastasia Posivets.
To read about the next steps, please visit our website.