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:

Databox - Read in the dropdown item list

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

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':

An empty Startup script

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.

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...

The Out of Hours Check Databox and Expression

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.

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.

The Databox dragged into the Script grid

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':

The fixed text 'OOH' in a Databox

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:

The completed script

Last updated