Databox Read
Pulling information out of a Databox
Last updated
Was this helpful?
Pulling information out of a Databox
Last updated
Was this helpful?
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:
The list of Databoxes that can be read from is displayed. Select the Databox and drag it onto the Script to the position required.
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':
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.
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.
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':
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: