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
DEPRECATED FUNCTIONS
Like a dictionary array... {a!map(date: _, value: _), ...}
Dan Tobias What other data structure would you recommend? I need to order to be preserved for my use case because I need to do a cumulative sum of values over time (keys: dates) after I create the dictionary.
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.
if( or(a!isNullOrEmpty(ri!fieldsAndValues),a!isNullOrEmpty(ri!dictionary)), ri!dictionary, a!localVariables( keys: a!keys(ri!fieldsAndValues), values: a!forEach(items: local!keys, expression: ri!fieldsAndValues[fv!item]), if(count(ri!dictionary) > 1, a!forEach( items: ri!dictionary, expression: a!update(fv!item, local!keys, local!values) ), a!update(ri!dictionary, local!keys, local!values) ) ) )
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))
If you wish to mimick the createdictionary() function with out-of-the-box functionality (as of 21.4), create an Expression Rule with the inputs of "keys" (List of Text) and "values" (Any Type) and use this as the body of the Expression:
a!update(cast(94, {}), ri!keys, ri!values)
Try updating just the "emails" property with local!mergedEmails as the value and see if you get a similar error. If you don't and the update works, you can combine 2 separate a!update() calls like so:
a!update( data: a!update( data: local!existingContactInfo, index: "emails", value: local!mergedEmails ), index: { "relatedEntityId", "relatedEntity" }, value: { ri!CO_Person.id, cons!CO_RELATED_ENTITY_PERSON })
Hi everyone, how can update a list of CDT in a CDT;
a!update( data:local!existingContactInfo, index:{"emails","relatedEntityId","relatedEntity"}, value:{local!mergedEmails, ri!CO_Person.id,cons!CO_RELATED_ENTITY_PERSON} ),
emails = list of cdt
local!mergedEmails= list of CDT (containing 2 elements)
getting this error :
Hi Daniel, we have used this plugin in our application. In light of the recent discovery of vulnerabilities with log4j2, we would like to know if this plugin uses the affected version Log4j2, and if yes, would you release an updated version of this plugin to counter the exploit of vulnerability?
Hi, updatedictionary is not working in forEach with a list of CDT's, it doesn't do any changes. This plugin works with 20.4 version?
Will this plugin still work on 16.2 version ?