**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
updatedictionary() can be mimicked with a function, having inputs "dictionary" (any type) and "fieldsAndValues" (map). The body of the function (expression rule) is as follows:
a!localVariables( keys: a!keys(ri!fieldsAndValues), values: a!forEach(local!keys, ri!fieldsAndValues[fv!item]), a!update(ri!dictionary, local!keys, local!values))
Here's an upgraded version of this code that handles null and empty values in both parameters and returns a value with the same structure (single value vs. array) as the input.
values: a!forEach(items: local!keys, expression: ri!fieldsAndValues[fv!item]),
if(count(ri!dictionary) > 1,
expression: a!update(fv!item, local!keys, local!values)
a!update(ri!dictionary, local!keys, local!values)
© 2023 Appian. All rights reserved.