Hi guys,
Let's say I have the following scenario. What I need is a third collection but combining the two collections like this. Any ideas of how to achieve this? These are completely independent collections, I can't use a lookup formula and these two collections will always have 1 column and the same number of rows.
Thanks
Collection 1
A
B
C
Collection 2
1
2
3
Collection 3
A | 1 |
B | 2 |
C | 3 |
Solved! Go to Solution.
Hi @CP0822 ,
Just checking if you got the result you were looking for on this thread. Happy to help further if not.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Hi @CP0822 ,
I am assuming you want to combine these simply in the order that are currently set in?
Hi @CP0822 ,
Firstly as you will see below, this is not straight-forward - I will give you my entire test code - you will not need the top two bits as they are simply making the two test collections, but one thing you should take away from it is to not have your field names called "Value" as you need this elsewhere in the code.
//These are the two test collections
ClearCollect(
col1,
{Field1: "a"},
{Field1: "b"},
{Field1: "c"},
{Field1: "d"},
{Field1: "e"}
);
ClearCollect(
col2,
{Field2: 11},
{Field2: 12},
{Field2: 13},
{Field2: 14},
{Field2: 15}
);
//Now add a row number to the first
Clear(col1A);
With(
{wList: col1},
ForAll(
Sequence(CountRows(wList)),
Collect(
col1A,
Patch(
Last(
FirstN(
wList,
Value
)
),
{RowNo1: Value}
)
)
)
);
//now add a row number to the second
Clear(col2A);
With(
{wList: col2},
ForAll(
Sequence(CountRows(wList)),
Collect(
col2A,
Patch(
Last(
FirstN(
wList,
Value
)
),
{RowNo2: Value}
)
)
)
);
//Now combine them into a third collection
Clear(col3);
Collect(
col3,
AddColumns(
col1A,
"OtherField",
LookUp(
col2A,
RowNo2 = RowNo1
).Field2
)
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Hi @CP0822 ,
Just checking if you got the result you were looking for on this thread. Happy to help further if not.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
User | Count |
---|---|
161 | |
86 | |
68 | |
63 | |
61 |
User | Count |
---|---|
212 | |
146 | |
92 | |
81 | |
68 |