Hi @DT69
You are mistaken regarding how to use a datatable. A datatable is a control that allows you to examine the data that already exists in a table or collection. To create a table from raw data, you can use the Table() function like in the example in the documentation. Once the data is created it is stored in a temporary file called a collection by wrapping the Table in a Collect() or ClearCollect() function. In the example below Collect is used to store the data and the collection is named mydessert. but you could name it anything you want. Remember collections exist only in memory and are erased when the app is closed.
Collect(mydessert, Table({Name: "Chocolate", Price: "$ 3.95", 'Quantity on Hand':
12, 'Quantity on Order': 10}, {Name: "Bread", Price: "$ 4.95",
'Quantity on Hand': 34, 'Quantity on Order': 0}, {Name: "Water",
Price: "$ 1.95", 'Quantity on Hand': 10, 'Quantity on Order':
10})
To execute the formula, place it in the OnSelect property of a button or icon. When you push it, it creates the collection from the data in the table. Then, when the button is pushed a collection called mydessert is created from the data. To view it, put a datatable or gallery control on the screen and set the Items property to: mydessert and you should see the following. 