CDT vs Record Type

Hi,

I am very new to Appian and i am going through some of the courses, which i think are very helpful.

I am reading and learning about CDT and Record Type. They look similar to me but i am sure there is something that i am missing. When would you use one vs another (example)? Appreciate your help and comments as i navigate and learn Appian.

Thank you!

  Discussion posts and replies are publicly visible

  • 0
    Certified Lead Developer

    A CDT is just a data structure which can be used in various places in applications. Examples are: customer data, invoice data, request data

    A record type is the connector for data, UI and processes and typically reflects the main business objects. Examples are similar to above, but are not just the data structure, but the data itself including UI representation and processes acting on that data.

    1. CDTs. All data in the world of programming needs to be "typed". You have "primitive" types (String, Boolean, Integer etc) that cannot be decomposed into anything smaller. And then you have "complex" types which are assemblies of primitive and/or other complex types. An "Address" might be a complex type, made up of, say, 4 lines of the address, a zip code and a country, all of which can be of a string type. You can use CDTs to map to database entities (tables, views). Note: not all CDTs HAVE to map to database entities. You can have a CDT in your application layer that is juts used locally to hold a set of related data for the purposes of processing locally.
    2. Records. I think of these as "entry points for processing". This is where you can surface you key business entities for the purposes of conducting some form of processing against them. Records can have different sources of data. They can be mapped directly to a database entity, or be sourced from a "service"; or can be sourced from in-flight process instances in Appian I've never seen this last one used but I include it for completeness). Most commonly they are database entity-backed. Note that not all of you entities needs to be surfaced as records. Consider which make most sense to surface for the purposes of finding something and then launching a process against that entity.
  • The other explanations are great, but I also have a quick rule of thumb:

    • Use a record type when viewing / displaying data
    • Use a CDT when editing / inserting data
  • 0
    Certified Associate Developer
    in reply to Peter Lewis

    Hi Peter, Is the above statement still valid, as we can insert/ edit data through record actions? Can we restrict CDT usage per the below guideline? And, between then and now, what is the difference between editing/inserting data with CDT vs Record types?

    "However, there are some cases where you may need to use custom data types (CDTs) in addition to your record types:

    A record type that does not have data sync enabled, so you need to connect to the source using a data store entity.
    You use a data type plug-in to define a CDT as a Java object.
    You create a custom document type for use with intelligent document processing. The document's fields are represented with a CDT.
    Your process model includes an Export Data Store Entity to Excel or Export Data Store Entity to CSV smart service node. Data store entities require a CDT as part of their configuration "

  • The statement above is no longer comprehensive, since now it is possible to also write data via records. The section you linked above from the "Working with Data in Appian" document is the latest recommendation. In general you can complete most activites using both Records and CDTs, but I recommend using records where possible because they are easier to manage and have specific benefits that CDTs don't (like being able to update a subset of fields).

    For others who come across this post, the best information about the current state of records and CDTs is available here: https://docs.appian.com/suite/help/latest/working-with-data-in-appian.html

    Also just a general suggestion - posts more than a year old are often out of date since we frequently update our product to continuously improve! If you have questions, it's usually better to create a new post instead of responding to existing posts Slight smile

  • 0
    Certified Associate Developer
    in reply to Peter Lewis

    Thank you Peter for sharing the knowledge link. Earlier, I was referring only to CDT Design Guidance. This document has really covered how and when to use all the Data objects.

  • 0
    Certified Associate Developer

    After reading the replies of the former members, I would like to add one more point to this discussion. Record types act as a blueprint of the database, that's why it is not required to query the database to display or view the data while using records. On the other hand, while using CDTs we need to query the database to view or display the data. This makes data management through record types faster and more efficient.

  • 0
    Certified Lead Developer
    in reply to tushark8069

    Sorry, but this is only half of the truth. Records do not store any data on their own, but rely on a backend system for data persistence.

    A CDT does also not store any data, but is just the definition of a data structure which CAN be used to write data to a DB using a data store.

    But in general, I agree. For most use cases Appian Records make live easier.

  • 0
    Certified Associate Developer
    in reply to Stefan Helzle

    In other words, I wanna say that Appian caches your data from an external database to memory or RAM while syncing record types. You only have to pull data from memory, it's faster than trying to pull the same information from the DB using the CDTs.