Create Data Relationships
Learning Objectives
After completing this unit, you’ll be able to:
- Explain how to create a data relationship in Salesforce Spiff.
- Describe how to view a record’s relationship with other records.
Explore Data Relationships
Typically, you keep commission data in multiple tables. When you first bring this data into Salesforce Spiff, all of these tables are isolated from one another. This is true if you’re using a CRM or manually importing the data. After you sync your data into Salesforce Spiff, the next task in hand is to connect these objects.
Let’s say you live on Deals island and your friend lives on Accounts island. To go from Deals island to Accounts island, you build a bridge, which in Salesforce Spiff is a relationship. To connect deals and accounts, they must have something in common. In this example, the Deals table has a CustomerAccount field that matches the IDs found in the external_id field on the Accounts table. The two tables share these interrelated fields, so you can connect deals and accounts. One deal is related to one account. Using this relationship, you can now access fields on the account records, such as OwnerId, ContractStartDate__c, and GoLiveDate.
Relationships are one-way bridges. If you want to connect accounts to deals, build a new relationship in this new direction. However, you can use the same interconnected fields to build this relationship. You can use the account’s external_id field to find deals that have matching entries in the CustomerAccount field. In this relationship, you can connect one account to many deals.
When creating relationships, it’s important to consider if this is a common one-to-one relationship or one-to-many, or a rare many-to-many relationship. As you work with your data, there can be many more relationships that exist between your tables. Do you create a relationship for every association that exists? No, you create the relationships that you need for your commission logic or data filters.
In this module, you learn how to create data relationships, and how to use those relationships to view related records on different objects within Salesforce Spiff.
Create Data Relationships
After you’ve synced your data to Spiff, here’s how to create a relationship.
- In Spiff Designer, navigate to the Data tab.
- Click Data Relationships.
- Click Create Relationship.
- Name the relationship and select the fields that link one table to another.
- Save your changes.
Relationship Naming Convention
Salesforce Spiff has a standard naming convention that we recommend for relationships. Remember these points when naming your relationships to provide crucial context and information.
- Reference the starting object and ending object. For example, if you’re creating a one-to-one relationship from deals to accounts, name this relationship DealToAccount. This name indicates the direction of the relationship and what tables you’re connecting.
- Use singular or plural names based on the type of relationship. In DealToAccount, both objects are singular, so you know it’s a one-to-one relationship. If you create a one-to-many relationship between an account and multiple deals, name it AccountToDeals.
View Related Records
Hover over a record on a datasheet and click that appears. You see options to view that record, or view related records. The View Related Records option shows you its relationships to records on other objects. This image shows an Opportunities record with several relationships to other objects.
Click any relationship to view a list of all related records. In this image, check out the user record that’s related to an opportunity record.
To visualize your relationships, check out the relationship map. This image shows an instance with several relationships. Notice how each relationship is connected and the type of relationship. Rearrange objects by dragging and dropping. You can also switch between a horizontal and a vertical view.
After you’ve set up a relationship, you can use it in data filters or in your payout rules. One-to-one relationships can access fields on the record directly, whereas one-to-many relationships can’t.
Now you know how to create data relationships in Spiff, and how to view records that are related to each other. In the next unit, learn more about the types of relationships that you can create.