Dictionary Manipulation

Overview

**NOTE: This plug-in is deprecated and no longer recommended for use for sites running on Appian 21.4 or later. The functionality of this component is available in Appian without installing the plug-in. You can use a!update() and a!keys() in Appian 21.4 or later.**

Dictionaries are one of the most useful data structures available in Appian. This plug-in provides tools to dynamically create dictionaries from key-value pairs, update dictionaries with new values (including nested dictionaries), and understand what keys are available in a dictionary to help with dynamic control.

Key Features & Functionality

FUNCTIONS

  • createDictionary - Takes a list of keys (Any Type) and a list of values (Any Type) and returns an Appian Dictionary representation of those data. The list of keys and values MUST be of the same length or an error will be thrown. If no keys are provided an empty Dictionary will be returned. This provides a high-performance, low difficulty means of creating dynamic dictionaries (no more fromJson())
  • updateDictionary - Takes a CDT or Dictionary to update as well as a CDT or Dictionary containing the keys and values to insert/update and returns the updated result. If the input was a CDT the output will be cast to the same type for data cleanliness. This can be used to update specific keys of the dictionary, or to merge two disparate dictionaries into one.
  • getKeysFromDictionary - Takes a CDT or Dictionary as input and returns a List of Text representing the included keys.

DEPRECATED FUNCTIONS

  • joinCdt:  Analogous to a SQL join statement. Useful for manipulating CDTs which are never written to a database.
  • expandCdt: Expands a CDT with a nested list or CDT.  It will create a new row for every value in a nested list or new column for every column in a nested CDT.   Also, an expanded list's column will be cast to a scalar value.
  • updateCdt: Takes in a CDT, dictionary, or list of either and a dictionary containing the updated values and returns the updated CDT.
Anonymous
Parents
  • Hi,

    I am trying to expand my CDT using expandcdt() function. It is given that the expand field parameter accepts input in "???function.expandcdt.param.expandField.description???" format. I am unable to figure out the input.

    My CDT structure looks something like below,

       empId: ""

      empDepartment: Department(nested CDT)

           dId:

           dName: ""

       empGender: Gender(nested CDT)

           gId:

           gName: ""

       lastName: ""

       firstName: ""

    Could you please help me with an example.

    Thanks in advance.

Comment
  • Hi,

    I am trying to expand my CDT using expandcdt() function. It is given that the expand field parameter accepts input in "???function.expandcdt.param.expandField.description???" format. I am unable to figure out the input.

    My CDT structure looks something like below,

       empId: ""

      empDepartment: Department(nested CDT)

           dId:

           dName: ""

       empGender: Gender(nested CDT)

           gId:

           gName: ""

       lastName: ""

       firstName: ""

    Could you please help me with an example.

    Thanks in advance.

Children