Hi All,
Need to manipulate a complex JSON from external Integration in Appian Interface, so using a Multiple CDT Structure which internally can contain multiple CDTs.
Sample Structure :
{
key1:value1,
key2:{key3:value3,key4:value4},
key5:value5
},
key1:xx,
key2:{key3:yy,key4:zz},
key5:aa
}
I am unable to use a!save to store multiple array-type, giving Error:Only fields with scalar types can be indexed from an array.
I am trying to save data like this :
a!save(target:ri!data, value: {dataId:local!termCode, formulationId:null,dataName:local!termName, otherDataName:local!otherName })
Process Model is not used, from interface, directly passing the cdt to another Integration, converting to JSON as we are using External DB.
An error occurred while executing a save: java.lang.IllegalArgumentException: Cannot index "dataDetails" because it is an array type (List of CTD_Data). Only fields with scalar types can be indexed from an array.
Please Let me know how to handle this.
Discussion posts and replies are publicly visible
First, create one expression_ex1 to form the nested cdt using type! constructor by passing [example key3:yy,key4:zz] and it should return nested cdt. Second, create another expression_ex2 to form the main cdt using type! constructor by passing main cdt field values and nested cdt formed in the first step. It should return main cdt. Thrird, in a!save() pass the main cdt to be stored in the desired variable.
Look at the same issue