Connecting the Dots: Building Record Type Relationships in Appian
Using record type relationships makes it incredibly easy to relate your enterprise data, ensuring you can quickly reference the exact data you need across your application. Continuing with our fictional company, Acme Auto, let’s explore how to connect the data in their fleet management application by linking vehicles, maintenance requests, and comments.
The Magic of Automatic Relationships Sometimes, Appian does the heavy lifting for you. For instance, when you create choice list fields during your initial data model setup, Appian automatically creates lookup record types for those values and relates them directly to your main record. Furthermore, any user fields you configure are automatically related to the system-wide User record type, which securely holds all the user data in your environment.
Step-by-Step: Creating Custom Relationships While automatic links are helpful, you will frequently need to manually connect your core business entities. Relationships can be added right when you generate a new data source, or at any point later during development.
Let's look at connecting Acme Auto's vehicles to their maintenance logs. If you already have a many-to-one relationship linking a maintenance request back to a vehicle, you also need to build the flip side of that connection: a one-to-many relationship on the Vehicle record.
Here is how you build it:
- Open the AA Vehicle record type. Under the Relationships section, click ADD RELATIONSHIP (Appian may even intelligently suggest the AA Maintenance record for you!).
- Search for and select the target record type: AA Maintenance.
- Choose the relationship type. Because one single vehicle will accumulate multiple maintenance requests over time, keep One to Many selected.
- Identify the common field that connects the two records. For both the AA Vehicle and AA Maintenance record types, you will select
vehicleId.
Pro-Tip: Writing Related Records During this configuration, you will see an option to "allow writing related records". If you enable this, you will be able to update related maintenance records at the exact same time you modify a vehicle record, which greatly speeds up process design and execution.
Whether you enable this feature depends entirely on your use case. For Acme Auto, it makes perfect sense to manage vehicles and their associated maintenance requests together. However, you likely wouldn't enable this for static reference data. For example, if your vehicle was linked to an "office location" record, you wouldn't want a user accidentally altering the official office address just because they were updating a vehicle stationed there. Reference data like that should be managed independently.
The Complete Picture Before you finish, Appian allows you to preview the relationship with test data to ensure the related maintenance requests are pulling through correctly. Once you click add, your new connection will instantly appear in the Data Model's relationship diagram.
By following these simple steps, you can build out a comprehensive web of connected data. For Acme Auto, developers can quickly add relationships to lookups for vehicle status, condition, and category. They can also add one-to-many relationships linking both Vehicles and Maintenance requests to an AA Comment record type, ensuring users can leave multiple comments on either object.
With just a few quick configurations, your data is seamlessly connected, making it exceptionally easy to reference related information anywhere in your Appian application!
Comments
Post a Comment