Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
6 replies
Subscribers
6 subscribers
Views
2797 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
Process
Hi I have a ReviewDocuments CDT which contains two multi value child CDTs.
suem
over 9 years ago
Hi
I have a ReviewDocuments CDT which contains two multi value child CDTs.
I have a documents array containing 2 documents and a CDT FieldworkAnalyticalReview array with 3 sets of details.
Each FieldworkAnalyticalReview needs to be associated with each of the documents
i.e.
Documents: {A,B}
FieldworkAnalyticalReviews: {1,2,3}
Which needs to become :
1. ReviewDocuments CDT ID=1 with 1A
2. ReviewDocuments CDT ID=2 with 1B
3. ReviewDocuments CDT ID=3 with 2A
4. ReviewDocuments CDT ID=4 with 2B
5. ReviewDocuments CDT ID=5 with 3A
6. ReviewDocuments CDT ID=6 with 3B
What would be the best way to achieve this.
Thanks
OriginalPostID-193229
OriginalPostID-193229
Discussion posts and replies are publicly visible
Parents
0
PhilB
A Score Level 1
over 9 years ago
Bit of a complex one this, but the below pretty much does what you want. Sue - I'll contact you directly with a more complete solution.
load(
local!documents: {"A", "B"},
local!reviews: {1, 2, 3},
local!reviewArray: reduce(
fn!append,
{},
apply(
fn!insert(
{},
local!reviews,
_
),
enumerate(
length(
local!documents
)
) + 1
)
),
local!documentArray: reduce(
fn!append,
{},
apply(
fn!insert(
{},
local!documents,
_
),
enumerate(
length(
local!reviews
)
) + 1
)
),
apply(
fn!concat(
_,
_
),
merge(
local!reviewArray,
local!documentArray
)
)
)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Reply
0
PhilB
A Score Level 1
over 9 years ago
Bit of a complex one this, but the below pretty much does what you want. Sue - I'll contact you directly with a more complete solution.
load(
local!documents: {"A", "B"},
local!reviews: {1, 2, 3},
local!reviewArray: reduce(
fn!append,
{},
apply(
fn!insert(
{},
local!reviews,
_
),
enumerate(
length(
local!documents
)
) + 1
)
),
local!documentArray: reduce(
fn!append,
{},
apply(
fn!insert(
{},
local!documents,
_
),
enumerate(
length(
local!reviews
)
) + 1
)
),
apply(
fn!concat(
_,
_
),
merge(
local!reviewArray,
local!documentArray
)
)
)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Children
No Data