Hi
I've two collections (that I created from SP List).
Collection 1 (DIVK) that has the following columns. (SerialNumber has UNIQUE values):
| SMN | MaterialDescription | SerialNumber |
| 1 | MD1 | S1 |
| 1 | MD2 | S2 |
| 2 | MD3 | S3 |
| 3 | MD4 | S4 |
| 3 | MD5 | S5 |
| 4 | MD6 | S6 |
| 4 | MD7 | S7 |
| 4 | MD8 | S8 |
| 5 | MD9 | S9 |
| 5 | MD10 | S10 |
| 5 | MD11 | S11 |
| 5 | MD12 | S12 |
Collection 2 (InstrumentGroups) that has the following columns (SMN has unique values):
| SMN | ModelGroup |
| 1 | MG1 |
| 2 | MG2 |
| 3 | MG3 |
| 4 | MG4 |
| 5 | MG5 |
I want to create one collection that reads as shown below. Which is basically:
- Adding a new column to the collection with the name of ModelGroup
- The ModelGroup of each record will be depending on the SMN value in InstrumentGroups Collection
- If SMN is blank in DIVK collection, I want to put in ModelGroup of the newly created collection "N/A".
| SMN | MaterialDescription | SerialNumber | ModelGroup |
| 1 | MD1 | S1 | MG1 |
| 1 | MD2 | S2 | MG1 |
| 2 | MD3 | S3 | MG2 |
| 3 | MD4 | S4 | MG3 |
| 3 | MD5 | S5 | MG3 |
| 4 | MD6 | S6 | MG4 |
| 4 | MD7 | S7 | MG4 |
| 4 | MD8 | S8 | MG4 |
| 5 | MD9 | S9 | MG4 |
| 5 | MD10 | S10 | MG4 |
| 5 | MD11 | S11 | MG4 |
| 5 | MD12 | S12 | MG4 |
I tried to use AddColumns but I was not successful. I hope someone can help me.

Report
All responses (
Answers (