I added new columns to an existing database table, but the CDT is not reflecting these changes. How can you update the CDT to include the new columns?
Answer
When you add columns directly to a database table, the matching CDT in Appian doesn’t pick them up automatically. You have to update the CDT yourself.
Step 1: Download the CDT’s XSD
- Open the CDT in Appian Designer.
- Click Settings → Download XSD.
- Open the downloaded file in a text editor.
Step 2: Add the new fields to the XSD
Add an element for each new column, using the appropriate XSD data type and JPA annotations. For example, suppose REQUEST_STATUS_ID and IS_ACTIVE are the two new columns.
Example 1: Integer field (foreign key)
Example 2: Boolean field
Step 3: Check the field mappings
While editing the XSD, check that:
- The
@Columnannotation names the correct database column. - The XSD data type (
xsd:int,xsd:boolean, and so on) is compatible with the column’s database type. columnDefinitionmatches the actual database type, such asINT UNSIGNEDorBIT, which depends on the database.@JoinColumnis configured correctly when the field is a foreign key.nullableandnillableare consistent with the database constraints.
Step 4: Upload the updated XSD
- Open the CDT in Appian Designer.
- Go to Settings → Create New Version from XSD.
- Upload the modified XSD file.
- Save the new version of the CDT.
- Check the corresponding Data Store to confirm the CDT fields map to the right database columns. Publish the Data Store if necessary and test the updated mappings.
Note: Updating a CDT can affect dependent objects, including Data Stores and running processes, so verify the changes and test the affected functionality.
Reference: Appian Documentation – Mapping CDTs to Database Tables
Check yourself
Question 1 of 3, on what the answer above covers.
- 1.A teammate adds two columns directly to a database table. What happens to the existing CDT in Appian?
- 2.You add a boolean field for a new IS_ACTIVE column. Which part of the XSD element tells Appian which database column it maps to?
- 3.You've uploaded the modified XSD as a new CDT version. What should you do next?