Appian Community and Appian Academy are being upgraded. From July 24–August 3, the Appian Community will be in read-only mode. During this time, the site will be read-only and user registration will be disabled. We apologize for any inconvenience this may cause, but a more secure, stable, and performant Community experience is coming soon!

The new Appian Community launches August 3, followed by Appian Academy on August 7. During the migration, Appian Community Edition, Appian Academy, Documentation, Certifications, Instructor-led Customer Training, Partner Sales Training & Accreditation, and Forum (for Appian Partners and Customers only) will remain available.

Dictionary Utilities

Overview

Contains the following functions:

  • dictUtil_getKeys
    • Returns a list of keys in the dictionary. If it's a nested dictionary, only the keys of top-level dictionary are returned. This function is typically used in cases where you need to pass a dynamic set of key/values. You provide a dictionary, call this function to retrieve the keys and then loop through them with an a!forEach or similar construct.
  • dictUtil_merge
    • Merges a list of dictionaries into a single dictionary. Key names must be unique across all dictionaries in the list.
  • dictUtil_newByKeyVal
    • Creates a dictionary with a single entry. The entry contains a key/value pair. This function is used when the a dictionary needs to be created on the fly; for dictionaries where the key is known, you may create a dictionary using regular Appian syntax. There's currently no way to create a multi-entry dictionary directly but you may use this function several times and then combine dictionaries with the dictUtil_merge function. 

The following example retrieves a list of all values in top-level elements of a dictionary. It would return the list: {1,2}.

with(
  local!dict: ({x: 1, y: 2}),
  local!keys: dictutil_getkeys(local!dict),
  a!forEach(
    items: local!keys,
    expression:         
       index(local!dict, fv!item, {})
  )
)

Anonymous