Skip to main content
By default, all attribute values are dynamically retrieved from the server when Record.attributes is accessed. When operating on many records, this can result in poor performance, as unnecessary data might be exported for each record and as export requests are performed for each individual record. By grouping records into fewer requests through batching, and allowing the export of only a subset of attributes, bulk_fetch() can be used to enhance performance.

Connect to MI

Specify a database and table.

Define a list of records to fetch

For example, by Record GUID.
Get each record using its Record GUID, using the get_records_by_ids method.
Previous cell output:

Fetch attribute data values

Fetch the Base, Density and Young’s modulus attribute values for each record, and print the results. Default units can be overridden before export using the table.set_display_unit() method.
Previous cell output:

Fetch meta-attributes data values

Meta-attributes can be included in a bulk export operation by specifying their AttributeDefinition, which can be obtained from the parent attribute definition. Accessing a meta-attribute that has not been exported will raise an error, even if the parent attribute has been exported. Fetch the attribute Food contact and associated meta-attribute Notes for each record and print the results.
Previous cell output: