Consumption
Specs
| Label | Value |
|---|---|
| Version | 5.1.0 (updated on 2026-11-12) |
| Developer | Labii Inc. |
| Type | Column |
| Support Configuration | Yes |
| Support Readonly view | Yes |
| Support Edit view | No |
| Support Form view | No |
| Support Default value | No |
| Support Import | No |
| Allow multiple | Yes |
Overview
Consumption Widget is a cutting-edge tool designed to streamline your laboratory operations. This innovative widget offers a seamless solution for calculating and tracking remaining volumes of samples or reagents. With its intuitive interface, researchers can effortlessly input initial volumes, record consumption data, and instantly view the real-time remaining quantities. The Labii Consumption Widget not only enhances accuracy but also saves valuable time, ensuring that your lab maintains optimal inventory levels and prevents unexpected shortages, ultimately boosting efficiency and productivity in your research endeavors. Say goodbye to manual calculations and hello to precision and convenience with the Labii Consumption Widget.
The consumption widget works with the Quantity widget, which stores each number together with its unit. When the total quantity and the consumed amounts are Quantity columns, the widget converts every amount to the unit of the total quantity automatically, so you do not need separate unit columns or conversion factors.
Use case
- Use this widget to display the remaining volume of a sample or reagent.
- Use this widget to display the total of checkin or checkout quantity.
- Use this widget to calculate the total amount of invoice from invoice items.
Configuration
The remaining volume of a sample or reagent can be determined using the following formula within the consumption widget:
$$ Remaining Volume (v) = Total Volume (V) - Sum(Consumption) $$
Therefore, the total volume column must exist in the current table, and the consumption table must record the amount used.
- Column (Quantity) - Choose the column for total quantity. With the Quantity widget, the remaining quantity is calculated in the unit of the quantity, and the consumed amounts are converted automatically. If this column is left blank, the returned value will be the sum of all consumption values.
- Table (Consumption) - Select a table designated for recording consumption data.
- Column (Source) of the Consumption table - Select the column in the consumption table that is associated with the current record.
- Column (Amount) of the Consumption table - Choose the column in the consumption table that records the amount or volume of the record used. Use the Quantity widget so that each amount has its own unit.
- Threshold - Configure the threshold value as either a specific number or a percentage to trigger a warning when the remaining volume falls at or below it. For instance, setting it to '10' will trigger a warning when the remaining volume reaches or falls below 10, while setting it to '10%' will raise a warning when the remaining volume is equal to or less than 10% of the total volume. With the Quantity widget, a number threshold uses the unit of the total quantity.
- Query - Further refine the displayed records by adding supplementary query criteria.
- Stop condition - The formula will stop calculation when the condition is met. It must return a
trueorfalsevalue. This field does not support other column data, you can only use the variabledatato reference the current record data. - Should auto update when readonly - If checked, this widget will perform a live calculation when readonly.
- Format - Formats the displayed number, with the same options as the Number widget, such as Format (decimals) and Format (thousand).
Unit conversion
When the quantity and amount columns use the Quantity widget, the widget calculates the result as follows:
- Each consumed amount is converted to the unit of the total quantity, for example
250 µLis subtracted from5 mLas0.25 mL. The result is saved in the unit of the total quantity. - Units are converted within the same dimension of the Quantity widget, such as volume or mass. The custom units of the quantity column are also recognized.
- A value without a unit has a factor of 1, the same as the base unit of each dimension, such as
µLorµg. - If Column (Quantity) is left blank, the result uses the unit of the first consumption record.
- If an amount cannot be converted, for example a mass is consumed from a volume, the widget shows the error
The unit <unit> of <record> can not be converted to <target>and does not save the result.
Older configurations may include the legacy keys quantity_unit (Column (Unit)), unit (Column (Unit) of the Consumption table), and conversions. These keys are no longer shown in the configuration form. They are still applied when the total quantity is a Number column, so existing columns keep working. To use automatic conversion, change the quantity and amount columns to the Quantity widget.
Example
Below is the widget configuration for calculating the remaining volume of a sample, where quantity and amount are Quantity columns.
{
"quantity": {
"sid": "xxx",
"name": "quantity"
},
"consumption": {
"sid": "xxx",
"name": "consumption"
},
"source": {
"sid": "xxx",
"name": "source"
},
"amount": {
"sid": "xxx",
"name": "amount"
},
"threshold": "10%",
"format": {
"decimals": "2",
"thousand": ","
}
}
Here is the widget configuration responsible for calculating the total stock checkins.
{
"consumption": {
"sid": "xxx",
"name": "checkin"
},
"source": {
"sid": "xxx",
"name": "stock"
},
"amount": {
"sid": "xxx",
"name": "quantity"
},
"format": {
"decimals": "2",
"thousand": ","
}
}
Here is a legacy configuration that uses Number columns with separate unit columns and conversion factors. Units missing from conversions use a factor of 1.
{
"quantity": {
"sid": "xxx",
"name": "quantity"
},
"quantity_unit": {
"sid": "xxx",
"name": "unit"
},
"consumption": {
"sid": "xxx",
"name": "consumption"
},
"source": {
"sid": "xxx",
"name": "source"
},
"amount": {
"sid": "xxx",
"name": "amount"
},
"unit": {
"sid": "xxx",
"name": "unit"
},
"conversions": [
{
"unit": "µL",
"factor": 1
},
{
"unit": "mL",
"factor": 1000
},
{
"unit": "L",
"factor": 1000000
}
],
"threshold": "10%"
}
Views
See the interface of the widget in the following views.
Readonly view
Readonly view displays the value of the column, followed by its unit when the result has one, such as 4.75 mL.
In the readonly view, a warning message will be shown when the remaining volume is equal to or less than the specified threshold.
Edit view
The Edit view is the interface that allows you to modify the value.
Edit view is not supported for this widget.
Form view
The Form view is the field integrated into the add form for collecting values when creating a new record.
Form view is not supported for this widget.
Data
Each widget in Labii stores data in a unique manner; refer below to understand how data from this widget is stored.
Data format
JSON data with the calculated value, an optional unit, and whether the value is at or below the threshold.
{
"value": 4.75,
"unit": "mL",
"is_low": false
}
- value - The remaining quantity, or the sum of the consumptions when Column (Quantity) is left blank.
- unit - The unit of the value. Saved only when the Quantity widget is used and the result has a unit.
- is_low -
truewhen the remaining quantity is at or below the Threshold.
Default value
The Default Value field within the column allows you to specify the default value when a record is created.
Default value is not supported for this widget.
Import value
The Import Value is the value you need to include in your Excel table for it to be imported into Labii.
Import value is not supported for this widget.
Notes
You can utilize the "is_low" key generated by the widget to sort through a list of samples that are running low and require ordering.
The widget exclusively operates within the Frontend. This means that if you have generated samples through importing and have never opened the detailed view of those samples, the column created with the consumption widget will remain empty. Consequently, the filtering results may not be entirely accurate. To rectify these errors, you can enable the "Edit View" option in the list view to update the consumption calculations in bulk.