Multiple Dropdown values to CDT column

Certified Lead Developer

Hi Team,

i have designed a CDT for Vehicle Maintenance where one of the column is for what are all the last performed services as per vehicle maintenance schedule.

latestScheduledServiceTypes Text 255 Checked the Array checkbox . 

So i do expect the column to store the list of values as it is an array?

Can a column in database be used to hold array of values? because in cloud db when i checked no value is getting saved in this column.

Even on the interface, i just displayed the value for this, i dont see any value for that column its just null.

Please help me with the significance of Array checbox in CDT's? and also how to store them into Cloud database.

Thank you!

  Discussion posts and replies are publicly visible

Parents
  • You shouldn't use the "array" option with a primitive field like text. As you mentioned, this will create a separate table in the database that cannot be directly queried from, which makes it difficult to access the data and can lead to performance problems.

    Instead, I'd recommend creating a separate CDT that stores the last management service types. This CDT should contain an id and the name of your service type. Then, in your original vehicle maintenance CDT, add a field for last maintenance service types that uses an array and your new CDT as the type. Once you do this, you will notice that a similar table is created in the database; however, this table can be directly queried from and the data structure will be easier to work with.

    One other way to do this is to not use nesting of CDTs and add another field to your newly created CDT for vehicleMaintenanceId. For more information on when to use nested CDTs vs. flat structures, please see the documentation: https://docs.appian.com/suite/help/latest/cdt_design_guidance.html

  • 0
    Certified Senior Developer
    in reply to Peter Lewis

    Hi Peter,

    I'm not sure to understand why you said that if we use the "array" option with a primitive field like text, the auto-generate table won't be directly queried. Could you give me more details please ?

    I've tried to create a CDT with this kind of table (auto-generated by Appian), and this table is listed among the ohers tables. So, I do not see why we could not access the data with a query ?

    Thank you in advance

  • 0
    Appian Employee
    in reply to cedric01

    The main issue is that you can't directly query the data - for instance, it isn't possible to only query the information from the primitive array without also querying from the original table. This means you end up with weird behavior because you have a table in your database that isn't represented by a corresponding CDT.

    It's not only performance though - it's also just that it makes it difficult to work with. For example, it isn't possible to define a filter on the data from the multiple field. However, if you create a separate CDT and table, then you can directly query that table and apply any filters as necessary.

    In general I've found that while it may seem easy to set up a primitive array, it makes it a lot harder to actually use the data, and I recommend using other design patterns instead.

Reply
  • 0
    Appian Employee
    in reply to cedric01

    The main issue is that you can't directly query the data - for instance, it isn't possible to only query the information from the primitive array without also querying from the original table. This means you end up with weird behavior because you have a table in your database that isn't represented by a corresponding CDT.

    It's not only performance though - it's also just that it makes it difficult to work with. For example, it isn't possible to define a filter on the data from the multiple field. However, if you create a separate CDT and table, then you can directly query that table and apply any filters as necessary.

    In general I've found that while it may seem easy to set up a primitive array, it makes it a lot harder to actually use the data, and I recommend using other design patterns instead.

Children