> For the complete documentation index, see [llms.txt](https://docs.keyfax.biz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.keyfax.biz/product-suite/admin/entities/databoxes/databox-read.md).

# Databox Read

Data held in a Databox can also be ‘read’. Reading from a Databox allows the data to be used elsewhere. For example, it may be data that is to be:

* used in a Message or Task
* read so that the data can be manipulated and then written to another Databox

To read data from a Databox, edit your script and select the **Databox - Read** option from the Item Type list:

<div align="center"><figure><img src="/files/9hdTPMTE6RDDqHMLJl7L" alt=""><figcaption><p>Databox - Read in the dropdown item list</p></figcaption></figure></div>

The list of Databoxes that can be read from is displayed. Select the Databox and drag it onto the Script to the position required.

### **Example**&#x20;

In a System Startup script, we will use a Databox to determine if your scripts are ever run outside of normal hours in which case, a different Script Set will be loaded.

Firstly, edit the System Script '**Startup**':

<div align="center"><figure><img src="/files/Gc15zLkTST7aWLocO0PP" alt=""><figcaption><p>An empty Startup script</p></figcaption></figure></div>

Locate the **SystemValues.OOH Check** Databox. This is included as part of the the Model content; if it doesn't exist, create one, add the Expression below and tick the '**Cond**' checkbox.

{% hint style="info" %}
By ticking the 'Cond' checkbox, this Databox provides a Conditional assessment where the script logic can determine if an Expression results in **True** or **False** and the script flow can deviate accordingly. Whenever you drag a Databox marked as '**Cond**' onto your grid, it will insert an '**Otherwise**' step to manage the script flow. See this in action below\...
{% endhint %}

<div align="center"><figure><img src="/files/rugILivRM2pmDUtoWJY1" alt=""><figcaption><p>The Out of Hours Check Databox and Expression</p></figcaption></figure></div>

Having located the Databox, expand it by clicking the small chevron and you'll see the Expression '**Between 0800 and 1800?**'. Drag this onto the script grid.

{% hint style="info" %}
If your script already has content and you wish to position the Databox at the very **top**, you will need to hold the **SHIFT** key down as you drag the Databox across.
{% endhint %}

<figure><img src="/files/HxdtwfvZFoS9oJySSgKl" alt=""><figcaption><p>The Databox dragged into the Script grid</p></figcaption></figure>

Because this is a Conditional expression, you can choose what action to take if the Expression is **true**. In this case, we will be doing another Databox Read by dragging '**Company.Script Set Code.Out of Hours**' into the script; this represents a fixed value, in this case '**OOH**':

<div align="center"><figure><img src="/files/XQSE5TPaZabK8TvV3HrS" alt=""><figcaption><p>The fixed text 'OOH' in a Databox</p></figcaption></figure></div>

To complete the script, add a Databox **Write** to store the value '**OOH**' in the Databox **Import.Tenancy** (for Repair Diagnostics, this is normally used to determine which Script Set to load at Startup. So the finished script looks like this:&#x20;

<div align="center"><figure><img src="/files/gIpBmU4IZCvTSijMgUNl" alt=""><figcaption><p>The completed script</p></figcaption></figure></div>
