Update Property In Array Of Objects

I am fairly new to Appian, and I want to dynamically update a property in array of objects (the objects are of any type).
so in terms of other programming language, something like below:

ri!List_Of_Any_Type_Object[ri!Index_Of_Object].<Property_Name> = value

OriginalPostID-248744

  Discussion posts and replies are publicly visible

Parents
  • There is a trick that uses updatecdt to update any field in a CDT. The problem with updatecdt is that you cannot create a dictionary with dynamic key names. To do that you create a dictionary with a fixed key name, convert it to JSON, replace the key name with your dynamic name and convert it back to an Appian dictionary. Check the code below. There is one issue. JSON does not handly date and datetime values correctly. To get this you can convert date/datetime values to a decimal. Appian automatically converts a decimal back to a correct date/datetime.

    a!fromJson(substitute(a!toJson({X_A_Z_Q_Y:local!valueExternal}), "X_A_Z_Q_Y", ri!name))
Reply
  • There is a trick that uses updatecdt to update any field in a CDT. The problem with updatecdt is that you cannot create a dictionary with dynamic key names. To do that you create a dictionary with a fixed key name, convert it to JSON, replace the key name with your dynamic name and convert it back to an Appian dictionary. Check the code below. There is one issue. JSON does not handly date and datetime values correctly. To get this you can convert date/datetime values to a decimal. Appian automatically converts a decimal back to a correct date/datetime.

    a!fromJson(substitute(a!toJson({X_A_Z_Q_Y:local!valueExternal}), "X_A_Z_Q_Y", ri!name))
Children
No Data