Skip to main content
hemantb0002
Known Participant
March 8, 2023
Question

How to insert data into DB in case of nested cdt?

  • March 8, 2023
  • 4 replies
  • 0 views

There is a requirement where i have to insert nested CDT(one to many) data into table and then read in another process model.

Parent CDT : policyDetails

policynumber

customerId

actiontype

nomineeDetails

Child CDT= nomineeDetails

{

title: "Mr",
forename: "abc",
surname: "Test One",
dateOfBirth: "01/01/2000",
percentage: 80,
relationship: "Brother",
addressLine1: "Hall Road"

}

{

title: "Mr",
forename: "xyz",
surname: "Test two",
dateOfBirth: "01/01/2006",
percentage: 50,
relationship: "sister",
addressLine1: "aaaaa",

}

My Approach : 

  1. Create two tables policyDetails & nomineeDetails with foreign key = policynumber
  2. Insert policy details into first tables without nomineedetails.
  3. Insert nominee details into second table using MNI in process model.
  4. Create 2 expression rules to read data from both tables and use it.

Do you guys feel that there should be better approach?

4 replies

stefanhelzle0001
Brainy
March 8, 2023

That depends a bit on the type of relationship. Reference vs. Parent-Child.

And I don't think you need MNI. You can just write multiple items in one go.

hemantb0002
Known Participant
March 8, 2023

[mention:126a676c85024855948336691b0a7b92:e9ed411860ed4f2ba0265705b8793d05] Thanks for quick reply. We have a Parent-Child relationship which is One to Many(One policy holder can have multiple nominee details)

stefanhelzle0001
Brainy
March 8, 2023

Please have a look at this page:

https://docs.appian.com/suite/help/23.1/CDT_Relationships.html#cascade

Depending on the cascade type you can just write the data through the parent.

abhayd3663
March 8, 2023

Appian recommends using nested relationships ONLY for one-to-one and many-to-one relationships. One-to-many and many-to-many relationships should be flat to avoid performance issues when querying data.