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 Lead Developer
    in reply to Peter Lewis

    Thank you so much Peter. That helped. i will try to use CDT as the type and will check the array checkbox

    Will get back as soon as i implement this.

  • 0
    Certified Lead Developer
    in reply to kowsalyav

    Hi Peter,

    i have gone through the CDT design guidance. It says One-to-Many should be a FLAT design?

    but in my case for one vehicle many services can be done(1-to-many) and i am now about to design a nested CDT for servicetypes as primitive datatype like TEXT cant take array.

    As suggested , for now i have created a nested CDT with id that references master table & serviceTypes (Text field & not an array).

    So this table will have no unique key, the data may look like

    Id(referencing main table)    service types

    1 BreakPads

    1 Fuel Change

    1 Filter Change

    One more help,

    In the interface, multiple dropdown will have the value as breakPads,Fuel Change,Filter Change.

    Should I take a new rule input for the nested table and what should I give near save selection to and selected Values – cant give directly to nested tables field as it is also a string.

    Should I use expression editor to split the multiple dropdown values ? and then store that array into nested cdt?

    Please help me understand.

Reply
  • 0
    Certified Lead Developer
    in reply to kowsalyav

    Hi Peter,

    i have gone through the CDT design guidance. It says One-to-Many should be a FLAT design?

    but in my case for one vehicle many services can be done(1-to-many) and i am now about to design a nested CDT for servicetypes as primitive datatype like TEXT cant take array.

    As suggested , for now i have created a nested CDT with id that references master table & serviceTypes (Text field & not an array).

    So this table will have no unique key, the data may look like

    Id(referencing main table)    service types

    1 BreakPads

    1 Fuel Change

    1 Filter Change

    One more help,

    In the interface, multiple dropdown will have the value as breakPads,Fuel Change,Filter Change.

    Should I take a new rule input for the nested table and what should I give near save selection to and selected Values – cant give directly to nested tables field as it is also a string.

    Should I use expression editor to split the multiple dropdown values ? and then store that array into nested cdt?

    Please help me understand.

Children