Hi Appian People!
I have this code that split the value inside the CDT.
So for example I have a CTD:
'type!{urn:com:appian:types}T_Sample'( name: "Person",
place: "City1,City2,City3"
)
When splitting the value, the output should be like this in an array form:
Expected: ["Person"; "City1,City2, City3"]
But the actual result I got is: ["Person"; "City1"; "City2; "City3"]
the place where split in different index where it shouldn't be.
This is my current code
local!splittedCDT:split( stripwith( tostring( ri!cdtVal ), "[] " ), "," ) local!updatedVal: a!forEach( items: local!splittedCDT, expression: replace(fv!item, 0, find("=", fv!item, 0), "") ),
Is anyone could help me with this? Thank You ahead.
Discussion posts and replies are publicly visible
Hi,
Hope this helps. (a!keys function will work for CDTs as well)
it wont work if the type is CDT, im always getting a result of null values even if my cdt has value. :'(
Im so sorry im using different parameter in index(). Thank You Very MUCH it helps a lot <3
This can be achived in a much simpler way as follows:
a!localVariables(local!keys: a!keys(ri!cdtVal),local!updatedVal: a!forEach( items: local!keys, expression: index(ri!cdtVal, fv!item) ),local!updatedVal)
And you can even omit all the local variables.
a!forEach( items: a!keys(ri!cdtVal), expression: index(ri!cdtVal, fv!item) )