Access an existing record
Connect to MI and specify a database and table.Access a linked tabular attribute
Access the tabular attribute Tensile test data used in this rollup.__repr__ shows that the tabular attribute is not loaded yet, and so additional information
about the number of rows and columns is not available.
Tabular data is loaded on-demand to improve performance, and reading or modifying the data will load the data
automatically. However, accessing the __repr__ does not trigger the load operation. To load the data manually, use
the .load() method.
Once the attribute is loaded, the __repr__ shows the number of rows and columns.
.column_name, .column_types, and .linked_columns properties list the tabular column names, types, and
whether the column is linked. Each of these properties contain 8 entries, which corresponds to the number of columns
in the tabular attribute, and the size printed in the tabular attribute __repr__.
.value property contains an immutable representation of the current state of the tabular attribute
value.
This property is useful as a high-level summary of the data, but should not be used for processing. The .rows
property described in the next section provides a richer representation of the data.
.linking_table and .linking_attribute properties contain the target table and target attribute. This is a
linked tabular attribute, so these properties return Table and AttributeValue objects respectively.
Tabular rows
The.rows property lists all rows. There are 9 TabularRow objects shown, which corresponds with the size printed
by the tabular attribute __repr__.
__repr__ contains the linking value and the row ID.
AttributeTabular.linked_records property. This returns
a dictionary mapping the linking value to the list of resolved records in the target table. Each row has a single
linking value, but in general a linking value may match zero or more records. In this example, each linking value
matches one record.
Tabular cells
The cells are available as a tuple of cell values via the.cells property, or by their column name via the
.cells_by_column property.
.value property, and picture and file tabular cell classes have a .save() method.
Linked tabular cell value objects differ from their local tabular cell value equivalents in that they are read-only.
Local tabular cell values are shown in the local tabular data example referenced in the introduction.
Short text cells have a .value property:
AttributeError:
.value and a .unit property:
Add a linked row
The.append_row() method accepts an optional argument to specify a linking value. The cell below creates a row which
link to all records in the target table with the value L14L12HIP1T in the target attribute.
__repr__ shows the linking value.
Add a local row
The.append_row() linking_value argument is optional. The cell below creates a local row, which will not contain
any linked data.
__repr__ shows the lack of linking value.
Delete rows
Delete rows by specifying the row index to delete. Use the length of the.rows tuple to get the number of rows, and delete the last two.