What are types of relationships in Appian CDTs?
What are types of relationships in Appian CDTs?
Answer
Types of Relationships in Appian CDTs
Custom Data Types (CDTs) in Appian support four types of relationships: one-to-one, many-to-one, one-to-many, and many-to-many.
Each one describes how records in one CDT associate with records in another.
1. One-to-one relationship
Each record in the parent CDT can be associated with only one record in the child CDT, and that child record cannot be shared with another parent.
Example: Employee and Address
- Each employee has one unique address.
- Each address belongs to only one employee.

Implementation in Appian:
For one-to-one relationships, Appian recommends a nested CDT design.
- The parent CDT (
Employee) contains a field of the child CDT type (Address). - The employee's address information can then be accessed directly through the parent CDT.
- A flat design also works: the
EmployeeCDT contains anaddressIdfield that references the primary key of theAddressCDT.
2. Many-to-one relationship
Multiple parent records can reference the same child record, but each parent record can reference only one child record.
Example: Order and Status
- Multiple orders can have the same status, such as "Pending", "Shipped", or "Delivered".
- Each order has only one status at a time.

Implementation in Appian:
Many-to-one relationships also use a nested CDT design.
- The parent CDT (
Order) can contain a field of the child CDT type (Status). - The order can then access its related status information directly.
- A flat design also works: the
OrderCDT contains astatusIdfield that references the primary key of theStatusCDT. This is useful when status values are maintained separately as lookup data.
3. One-to-many relationship
One parent record can have multiple child records, but each child record belongs to only one parent.
Example: Case and Comments
- A single case can have multiple comments.
- Each comment belongs to one specific case.

Implementation in Appian:
One-to-many relationships use a flat CDT design, which avoids the performance issues associated with nested lists.
- The parent CDT (
Case) contains the case information. - The child CDT (
Comment) contains acaseIdfield that references the primary key of theCaseCDT. - The parent CDT does not contain a list of
CommentCDTs. - Comments for a particular case are retrieved by querying the
CommentCDT using thecaseId.
This gives you better control over database queries and avoids retrieving child records you don't need.
4. Many-to-many relationship
Multiple records in one CDT can be associated with multiple records in another CDT.
Example: Order and Products
- A single order can contain multiple products.
- The same product can be included in multiple orders.

Implementation in Appian:
Many-to-many relationships use a flat CDT design with a separate mapping (join) CDT. Three CDTs are involved:
Ordercontains order information, withorderIdas its primary key.Productcontains product information, withproductIdas its primary key.OrderProductis the mapping CDT. It holdsorderIdandproductIdas foreign keys referencing their respective CDTs.
Each record in OrderProduct represents one association between an order and a product. When required, the mapping CDT can also store additional fields, such as quantity or unitPrice.
Summary
Relationship | Example | Recommended CDT design |
|---|---|---|
One-to-one | Employee and Address | Nested |
Many-to-one | Order and Status | Nested |
One-to-many | Case and Comments | Flat |
Many-to-many | Order and Products | Flat with mapping CDT |
Reference: Appian Documentation — CDT Design Guidance
Check yourself
Question 1 of 3, on what the answer above covers.
- 1.Many orders can share the same status (Pending, Shipped, Delivered), but each order has only one status. Which relationship is this?
- 2.A case can have many comments, and each comment belongs to one case. Which design does Appian recommend?
- 3.An order can contain many products, and a product can appear in many orders. What do you need to model this?