Global Tables can store numbers, strings, pointers, arrays, FlexScript, bundles or tracked variables. This data can be accessed by any object in the model using the Table class interface. A model may have any number of Global Tables.
Global Tables are accessed from the Toolbox.
Here are some code examples of getting and setting table data.
Table myTable = Table("GlobalTable1");
myTable[1][1] = 5;
myTable[2]["MyCol"] = "Test";
item.LabelName = myTable[1][2];
double value = Table("GlobalTable1")[1]["Col 3"];
To edit a cell in the table, click the desired cell and begin typing to overwrite all data in the cell, or double click on the cell to select the cell's contents. You can also right-click a cell and select Explore As Table or Explore As Tree and edit the cell's data through there. If the cell has array or bundle data, double-clicking the cell will open a new table window for editing.
Use the arrow keys to navigate between cells. Cells hold number data by default. You can change a cell's data type by right-clicking on the cell and selecting an option under the Assign Data menu. The right-click menu also has options for insert/deleting rows and columns, clearing cell data, and sorting by column.
If the "Use Bundles" checkbox is checked, your table will change internally to use the bundle data type. This means that your table will take significantly less memory. However, there are some limitations. All data in a column must be of one type (number, string, or node) and rows can no longer be named. The data type of a column can be changed by right-clicking in a cell in the column. All of the normal table functions will work with the bundle data type.
Using bundles for your table data is highly recommended for large tables with over 500 rows or columns.
Cells in a table can store a variety of different types of data. These include:
Table("GlobalTable1").cell(1, 1).evaluate()
Additionally, a cell can also store a table of data. This can be done regardless of the data stored on the cell. To create a table on a cell, right click on the desired cell and select Explore As Table. This will open a new table window where you can add rows and columns to the cell. If a cell has a table, a small gray triangle will be drawn in the upper right corner of the cell.
Tracked Variable cells will display with a small green triangle in the upper right corner.
If a cell has array or bundle data, double-clicking on the cell will open a table view that can be edited.