Relationships between data objects
You can use data relationships to create relationships between data objects.
For example, when customers sign up for a video streaming account, they provide basic information such as first name, last name, and email. The value provided in the email field must be associated with the customer's first and last name because that email belongs to the customer. These three associated values can be captured in a Customer data relationship.
A data relationship is a single entity that contains multiple fields. The data relationship does not store data itself but instead acts as a container to associate a set of related fields. In the Customer data relationship example, the data relationship establishes a common context for the first name, last name, and email fields. These fields all contain data that describes a customer, as shown in the following image.
Data relationships with multiple records
You can configure data relationships to reference a single record or multiple records. The difference is that a multiple record data relationship references a list of grouped values. The customer example in the previous section is an example of a single record data relationship.
A video streaming company runs marketing campaigns by using customer information collected when users sign up for an account. The Campaign case type uses a Current Customers multiple record data relationship. The Current Customer data relationship includes records for each customer.
In the center of the following image, slide the vertical line to view the customer data with multiple records on the left and the system configuration on the right.
Data in data relationships
A case type or data object defines the data model for the data relationship. You can create a data relationship either by creating a new data object or by using an existing data object or case type. In the Current Customers multiple record data relationship example, the Customer data object defines the data model for the data relationship.
Each data relationship does not have to use all the defined fields, but they are all available. For example, you can use a Customer data relationship to capture customer information for users, including first name, last name, email, user name, and password. You can use the same Customer data relationship to display information on the Confirmation page. Because the user needs to confirm only the full name and email, the user name and password are not displayed. The fields remain part of the Customer data object and can be referenced in another view.
The data relationship with multiple records serves as a template for each grouped field instance. In a multiple record data relationship, each value follows the field type configuration settings. For example, you want to collect a job applicant's references in a multiple record data relationship that includes the reference's full name, company, contact number, and email. You can configure the Full Name and Contact Number fields as required values, so each new field under the Full Name and Contact Number columns has the same settings. In the following image, the applicant receives an error message when they do not enter a contact number for Shaun Mills.
You can also configure a multiple record data relationship to allow end users to add, delete, or update items as needed. For example, the References data relationship is displayed as a table with three groups or rows of related values. An applicant can add a fourth reference to the list by clicking Add item.
A data object can contain other data objects so that a data relationship can contain other data relationships. For example, in an online shopping application, customers can have multiple credit cards associated with an account. In the application, the Customer entity is a single record data relationship and the Credit Cards entity is a multiple record data relationship. Each entity has a relationship with a respective data object.
In the following image, the Customer entity captures and associates the customer's full name, username, password, and credit cards to the referenced data object. Within the Customer entity, the Credit Cards entity captures and associates the card number, expiration date, and verification code to the referenced data object. Each customer can store multiple credit cards on the account, adding, deleting, and updating card information as needed.
Check your knowledge with the following interaction.