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.

Is there a way to *dynamically* add a new element to a dictionary?

I'd like to at run time add new name value pair to a dictionary. Is this possible?

Thanks.

OriginalPostID-239395

  Discussion posts and replies are publicly visible

Parents
  • The problem is that updatecdt does not allow dynamic field names. But if you add

    a!fromJson(substitute(a!toJson({tzqYx62_01_:ri!value}), "tzqYx62_01_", ri!key))

    to the above code, even that is possible. It creates a dictionary with a fixed field name and converts it to JSON. Then it replaces the field name in the JSON string to the desired field name and converts it back to an Appian dictionary.
Reply
  • The problem is that updatecdt does not allow dynamic field names. But if you add

    a!fromJson(substitute(a!toJson({tzqYx62_01_:ri!value}), "tzqYx62_01_", ri!key))

    to the above code, even that is possible. It creates a dictionary with a fixed field name and converts it to JSON. Then it replaces the field name in the JSON string to the desired field name and converts it back to an Appian dictionary.
Children
No Data