Hi there,
I have one CDT array
{
{a: 1,
b: "R"
},
{a: 2,
b: "E"
{a: 3,
}
what's the good way to update field b from "R" to "T". tried this, it does not work.
a!update(CDT.b, {1, 3}, "T")
anyone has the experience dong this?
Regards,
Lin
Discussion posts and replies are publicly visible
a!forEach( items: local!list, expression: if( fv!item.b = "R", update( data: fv!item, index: "b", value: "T" ), fv!item ) )
If you need null safety, index() function on line 4
Unknown said:If you need null safety, index() function on line 4
fun fact: as far as i can tell, "fv!item" is null-safe for dot properties much like "fv!row" is - meaning, accessing a nonexistent property simply results in a null rather than an error.
a!localVariables( local!asdf: { { idx: 1 }, { idx: 2 } }, a!forEach( local!asdf, fv!item.name ) )
Noice!