Skip to main content
pradeepb0001
January 20, 2022
Question

merging cdt

  • January 20, 2022
  • 6 replies
  • 0 views

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

6 replies

stefanhelzle0001
Brainy
January 20, 2022

A foreach and a lookup to the other list should do that. What did you try?

pradeepb0001
January 20, 2022

i am looking for suggestions,yet to try.

stefanhelzle0001
Brainy
January 20, 2022

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)
    )
  )
)