Does anyone know how to populate a CDT array from one or more arrays



Does anyone know how to populate a CDT array from one or more arrays via dictionary syntax?

For example, I want to generate:
{'type!{myNamespace}MY_Cdt'(first: 1, second: "A"),
'type!{myNamespace}MY_Cdt'(first: 2, second: "B"),
'type!{myNamespace}MY_Cdt'(first: 3, second: "C")}

From these arrays:
firstArray: {1,2,3}
secondArray: {"A","B","C"}

I've tried the following syntax, but it just stores the arrays in a scalar CDT:
'type!{myNamespace}MY_Cdt'(first: firstArray, second: secondArray)

My work around right now is to create a rule that assigns values to a scalar CDT and then run an apply() over the arrays.

I'd rather populate the CDT dynamically without the extra rule if possible.

I appreciate the help and have included the code in the attached file for ease. Thanks.

populateCdtArray.txt

OriginalPostID-143870

OriginalPostID-143870

  Discussion posts and replies are publicly visible

Parents Reply Children
No Data