> 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

Pulling information out of a Databox

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="https://2882349412-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MARm6St_qFGM52R3pBa%2Fuploads%2FdyE5s7tEHgH9LMHf5OyD%2F2023-05-04_18h14_52.png?alt=media&amp;token=8bef65e7-7f9a-4949-87f0-f47555a7945e" 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="https://2882349412-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MARm6St_qFGM52R3pBa%2Fuploads%2FO0ZJMUFdFjp9su8JcYmV%2F2023-05-04_18h28_14.png?alt=media&amp;token=fff59c93-a94c-4f29-b563-2cf0135018b1" 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="https://2882349412-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MARm6St_qFGM52R3pBa%2Fuploads%2FZYNXqovIlifkKVrSh2gM%2F2023-05-04_18h39_41.png?alt=media&amp;token=be1f54d5-ea73-4018-9ace-5edd6d6f2305" 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="https://2882349412-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MARm6St_qFGM52R3pBa%2Fuploads%2FwVpxpoArqf2KR1wPEcyL%2F2023-05-04_18h45_50.png?alt=media&amp;token=ed101e12-13a3-42fe-97a7-8d4f3057d7c8" 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="https://2882349412-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MARm6St_qFGM52R3pBa%2Fuploads%2FLHxxVR06Pf5YLttzqilF%2F2023-05-04_18h52_40.png?alt=media&amp;token=ed390c46-dfd5-4e4f-bd9f-65913b960b36" 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="https://2882349412-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MARm6St_qFGM52R3pBa%2Fuploads%2FIa8QZWYGKAPS8SdDxyvM%2F2023-05-04_18h53_44.png?alt=media&amp;token=7af60324-94b5-45df-8b5e-f4b908e936bc" alt=""><figcaption><p>The completed script</p></figcaption></figure></div>
