Export a Collection To A Datasource (SharePoint List, Excel, SQL, CDS)

Input collection: myOrders54

OrderIDItemUnitsOrderedCostPerUnit
1001Notebook252.5
1002Crayons158.62
1003Binders1013.34
1004Pencils211.5
1005Erasers300.89


Output to datasource: mySolution54

OrderIDItemUnitsOrderedCostPerUnit
1001Notebook252.5
1002Crayons158.62
1003Binders1013.34
1004Pencils211.5
1005Erasers300.89


Solution code:

//Create a collection
ClearCollect(myOrders54,
{OrderID: 1001, Item: "Notebook", UnitsOrdered: 25, CostPerUnit: 2.5},
{OrderID: 1002, Item: "Crayons", UnitsOrdered: 15, CostPerUnit: 8.62},
{OrderID: 1003, Item: "Binders", UnitsOrdered: 10, CostPerUnit: 13.34},
{OrderID: 1004, Item: "Pencils", UnitsOrdered: 21, CostPerUnit: 1.5},
{OrderID: 1005, Item: "Erasers", UnitsOrdered: 30, CostPerUnit: 0.89}
);

//Collection to datasource code
Collect(your_datasource_name, myOrders54);