Is there a why to create a local dynamic CDT in SAIL? I would be asking the user

Is there a why to create a local dynamic CDT in SAIL? I would be asking the users to give me the names of the columns and displaying the information in a grid.

OriginalPostID-157344

OriginalPostID-157344

  Discussion posts and replies are publicly visible

  • Are you utilizing this in a form or testing in the interface designer? If you're testing you can just set the value to your CDT type in your input parameters with the type!cdtname() expression.
  • You can easily create a data dictionary of any structure in an expression just using { } type syntax.. such as this example

    load(
    local!MyCustomData:
    {
    {
    label: "Name",
    field: "c0",
    drilldownField: "dp0",
    configuredFormatting: "NORMAL_TEXT",
    configuredDrilldown: "PROCESS_DASHBOARD"
    },
    {
    label: "Priority",
    field: "c7",
    drilldownField: "dp7",
    configuredFormatting: "PRIORITY",
    configuredDrilldown: ""
    },
    {
    label: "Status",
    field: "c8",
    drilldownField: "dp8",
    configuredFormatting: "PROCESS_STATUS_ICON",
    configuredDrilldown: ""
    },
    {
    label: "Started by",
    field: "c1",
    drilldownField: "dp1",
    configuredFormatting: "USER_NAME",
    configuredDrilldown: ""
    },
    {
    label: "Start Time",
    field: "c2",
    drilldownField: "dp2",
    configuredFormatting: "DATE_TIME",
    configuredDrilldown: ""
    },
    {
    label: "Active Tasks",
    field: "c9",
    drilldownField: "dp9",
    configuredFormatting: "NUMBER",
    configuredDrilldown: ""
    }
    },

    /* Now you can refer to any element in your local variable using . delimeter.. such as */

    local!MyCustomData[1].label

    )


    This would return "Name".. the label value for the first element in the array.
  • @brandonc Just to add to other's valuable suggestions, I would like to put forward my suggestion based on your description 'asking the users to give me the names of the columns and displaying the information in a grid'.

    My understanding as per this sentence is that you may want to surface the data in the grid upon the selection of the columns. If it is so, it could be doable by playing with the components used inside the grid and APN_uiPagingGridAutoColumns, one of the Appian Common Objects, is a classic example for this. In this case a dynamic CDT may not be needed.
  • I'm also interested in an answer to this question. I have a dictionary syntax data structure (not associated with a CDT) that I'm trying to manipulate before displaying. Can I build a dictionary data type with dynamic keys? For example:
    with(local!key:"a",{local!key: 1}). Returns {key:1} instead {a:1}