Hi,
i have a requirement where i need to get data of same cdt type from 2 different places and combine them together to display in a interface.
cdt 1: type!A{key:"100", field1:"test1"}
cdt 2: type!A{key:"100", field2:"test2"}
after merging output should be like this type!A {key:"100", field1:"test1",field2:"test2"}.Any suggestions will be really helpful.
Thanks in Advance.
Pradeep.B
Discussion posts and replies are publicly visible
A foreach and a lookup to the other list should do that. What did you try?
i am looking for suggestions,yet to try.
a!localVariables( local!typeA: { {key:"100", field1:"test11"}, {key:"101", field1:"test12"}, }, local!typeB: { {key:"100", field2:"test21"}, {key:"101", field2:"test22"}, }, a!forEach( items: local!typeA, expression: a!update( fv!item, "field2", displayvalue(fv!item.key, local!typeB.key, local!typeB.field2, null) ) ) )
Thank you for your reply, but having a doubt in this code snippet.
a!update( fv!item, "field2", displayvalue(fv!item.key, local!typeB.key, local!typeB.field2, null) )
if there are more fields in cdt ,is there any dynamic way to get each field parameter for eg: "field2" in cdt
https://docs.appian.com/suite/help/21.4/fnc_informational_a_keys.html
What do you want to achieve? Do you really need to merge that data?
Thank you, this will help.