This article gives an explanation of what data we can pull with the use of our App and Data Salesforce connectors and what are the limitations these connectors currently have.
Prerequisites
|
What data can we access?
In Salesforce, we think about database tables as objects, we think about columns as fields, and rows as records.
In general, with Templafy's App and Data connectors, we have access to the full object tree from Salesforce, including their fields and records. This predominantly means standard and custom objects.
Standard objects are objects that are included with Salesforce. Common business objects like Account, Contact, Lead, and Opportunity are all standard objects.
Custom objects are objects that you create to store information that’s specific to your company or industry.
Object types for standard objects are usually the singular CamelCase version of the object name. For example, the object type for contracts is Contract
and for opportunities is Opportunity
. A complete list of standard object types can be found here.
For custom objects, the object type can be found by going to the Salesforce setup page, clicking Objects under Create, finding the custom objects, and clicking its label. The object type can then be found under API Name. Custom object types usually end in __c
.
What datatypes do we support?
Every field within Salesforce has a defined data type. At the moment, with Templafy connectors, we can only support the following Field data types:
ID, BOOLEAN, TEXTAREA, STRING, EMAIL, PICKLIST, DATE, DATETIME, INTEGER, LONG, DOUBLE, CURRENCY, and PERCENTAGE.
How to know what is the relationship between objects, or what is the datatype field of a specific object you are looking to use
When configuring Templafy Dynamic Templates, it can be very useful to know what datatype is a specific field, or what is the relationship between certain objects. One of the most common ways is to use the Salesforce Workbench. Workbench is a powerful application that helps you interact with your Salesforce data.
In the following example, we have an Opportunity
object, with many child objects such as Account
, Owner
, Products
, ContactRole
, and many more.
Let's find the datatype of a specific field of the ContactRole
object and the relationship between this object, the Contact
, and the Opportunity
object.
For the purpose of this example, Opportunity
will be object 1, ContactRole
is object 2, and Contact
is object 3.
Workbench displays the objects’ child relationships, the record types, attributes, fields, and supported scopes. To access Workbench, log in with your Salesforce credentials here. Under info, click Standard & Custom Objects and choose the object you want to describe:
If the fields folder is expanded, as well as a specific field such as CreatedDate
or ContactID
, their datatype and their relationship can be seen:
In this case, ContactRole
has a field called ContactID
which is a reference to another object called Contact
, and a field CreatedDate
which is a DateTime datatype.
Limitations:
If the field of a particular object is missing from what the App or Data connector are pulling respectively, the reason could be that we don't support a specific field datatype, or the relationship between the objects is too far out, or the App connector has not been configured correctly.
App Connector:
- Due to Salesforce limitations, we are limited to a specific amount of time for how long each query can run. This means we can only fetch the parent level and the immediate child object. E.g
Accounts_c
(Parent) andContracts_r
, but we cannot pull the information of the child ofContracts__r
.
In other words, we cannot pull related objects of related objects.
Thus, in our previous example, we can only pull one level of data like this:Opportunity
->OpportunityContactRole
.
So something like the following is not possible with only the App ConnectorOpportunity
->OpportunityContactRole
->Contact
.
This means that pulling information about the contact such as itsName
orTitle
with only the App connector is not possible. However, in the last part of this article, there is an example of how this information can be pulled with the use of the Data connector working in unison with the App connector. - Another limitation is that with the App connector there is a limit on how many related objects, and their respective information, we can pull from one specific object. At the moment, we can only specify 5 different Related Objects. This is what you configure under "related objects" when configuring the Templafy App connector button:
Data Connector:
- When working in the Admin section of the External Data Sources, we can only show 10 objects. However, this preview is not an indication that the data isn't being properly fetched. We can actually pull all the objects from one data source.
- We can only show text fields. Any field that is a formula will not be displayed in the Preview mode.
How to link partial information being pulled by the App Connector with the full power of the Data Connector
Opportunity
and let's say we want to pull the Name
and Title
of a Contact
assigned to this opportunity. If we look at what the App connector is pulling through the browser's console, we can see that this information is not present. This is due to the limitation of how many related objects we can reference at a particular instance:ContactId
is still being fetched. This is the key field we will use to reference a specific object in an external data source being fetched by the data connector to pull its attributes. - Create a Contact external data source from Salesforce in the Templafy Admin center. From this data source, we will pull its name by making a reference to its
ContactId
that is being fetched by the App connector:
- Pull in the contact's information using the external data source binding, in which you feed the App connector input.
The usual syntax for an External Data source is:{{ExternalDataSources.DataSourceName[FirstColumnValueToLookUp].ColumnName}}
The syntax adapted to our Salesforce example would be:{{ExternalDataSources.<Salesforce contacts data source name>.[Object's field value for contact id].Column Name in the data source}}
So for our concrete example, the binding would be this:{{ExternalDataSources.Contact.[HostSystem.OpportunityContactRoles[0].ContactId].Name}}
In this case, we are linking the Contact's ID with its Name and this binding would return the name "Andy Young".
Comments
Article is closed for comments.