# Column Data

## **Specs**

<table><thead><tr><th width="320">Label</th><th>Value</th></tr></thead><tbody><tr><td><strong>Version</strong></td><td>1.1.0 (updated on 2025-04-14)</td></tr><tr><td><strong>Developer</strong></td><td>Labii Inc.</td></tr><tr><td><strong>Type</strong></td><td>Column</td></tr><tr><td><strong>Support Configuration</strong></td><td>Yes</td></tr><tr><td><strong>Support Readonly view</strong></td><td>Yes</td></tr><tr><td><strong>Support Edit view</strong></td><td>No</td></tr><tr><td><strong>Support Form view</strong></td><td>No</td></tr><tr><td><strong>Support Default data</strong></td><td>No</td></tr><tr><td><strong>Support Import</strong></td><td>No</td></tr><tr><td><strong>Allow multiple</strong></td><td>Yes</td></tr></tbody></table>

## Overview

The Column Data widget is designed to display data from another record in a source. It differs from the [Column Citation](https://docs.labii.com/widgets/column-widgets/column/column-citation) widget as it saves a copy of the data in the widget for quick loading. This widget is particularly useful for displaying text-type data, and it can be automatically updated to reflect changes in the source.

## Use case

1. Stock checkout: Display the same unit as the stock using the Column Data widget.

## Configuration

To enable the widget's functionality, it requires the provision of options. Each option comprises the following fields:

* **Source column**: Select one of the ForeignKey columns to define the data source.
* **Field**: Choose the field you want to display.
* **Stop condition:** The formula will stop calculation when the condition is met. It must return a `true` or `false` value. This field does not support other column data, you can only use the variable `data` to reference the current record data.
* **Should auto update**: If checked, the widget will reload data from the source.
* **Should auto update when readonly** - If checked, this widget will perform a live calculation when readonly.

### Examples:

```json
{
    "column": {"sid":"", "name":""},
    "field": "name",
    "should_auto_update": false,
    "stop_condition": "data !== \"\""
}
```

## Views

See the interface of the widget in the following views.

### **Readonly view**

Readonly view display the values of the column.

<figure><img src="https://github.com/Labii/labii-gitbook-docs/blob/gitbook/widgets/.gitbook/assets/widget-column-column-data.webp" alt=""><figcaption></figcaption></figure>

### **Edit view**

The Edit view is the interface that allows you to modify the value.

Edit view is not supported.

### **Form view**

The Form view is the field integrated into the add form for collecting values when creating a new record.

The Form view is not supported.

## Data

Each widget in Labii stores data in a unique manner; refer below to understand how data from this widget is stored.

### Data format

Same data format as the source record field. It can be anything but mostly the text.

### **Default value**

The Default Value field within the column allows you to specify the default value when a record is created.

You can assign any data type as the default value, but it is advisable not to set a default value as it might hinder the widget from loading data from the source.

### **Import value**

The Import Value is the value you need to include in your Excel table for it to be imported into Labii.

You can assign any data type as the import value, but it is advisable not to set a import value as it might hinder the widget from loading data from the source.
