Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Suggested Answer
+1
person also asked this
people also asked this
Replies
3 replies
Answers
1 answer
Subscribers
8 subscribers
Views
2526 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
Does anyone know how to populate a CDT array from one or more arrays
corbinp505
over 9 years ago
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
Top Replies
Conor Cahill
over 9 years ago
+1
suggested
Certified Lead Developer
have you tried the following? apply( 'type!{myNamespace}MY_Cdt'( first: _, second: _ ), merge( firstArray, secondArray ) )