JOIN All Columns From Another Collection

Input collection: mySales4

ProductIDQuantitySold
10014
10025
10017
10001
10008


Input collection: myProduct4

ProductIDProductNameUnitPriceStock
1000Jacket7010
1001T-Shirt304
1002Baseball Cap208


Output collection: mySolution4

ProductIDQuantitySoldProductNameUnitPriceInStock
10014T-Shirt304
10025Baseball Cap208
10017T-Shirt304
10001Jacket7010
10008Jacket7010


Solution code:

//Create two collections
ClearCollect(myProduct4,
{ProductID: "1000", 'ProductName': "Jacket", UnitPrice: 70},
{ProductID: "1001", 'ProductName': "T-Shirt", UnitPrice: 30},
{ProductID: "1002", 'ProductName': "Baseball Cap", UnitPrice: 20}
);

ClearCollect(mySales4,
{ProductID: "1001", QuantitySold: 4},
{ProductID: "1002", QuantitySold: 5},
{ProductID: "1001", QuantitySold: 7},
{ProductID: "1000", QuantitySold: 1},
{ProductID: "1000", QuantitySold: 8}
);

//Add all columns from another table code
ClearCollect(mySolution4,
    Ungroup(
        DropColumns(
            AddColumns(
                mySales4,
                "myGroupedColumn",
                Filter(
                    myProduct4,
                    ProductID=mySales4[@ProductID]
                )
            ),
            "ProductID"
        ),
        "myGroupedColumn"
    )
);