Difference between revisions of "Using a Databox - Conditional Assessment"

From Keyfax Wiki
Jump to: navigation, search
(Created page with "Home > Databoxes > Using a Databox - Conditional Assessments Using a Databox - Conditional Assessments As well as reading from a Databox (with the intention of writing the d...")
 
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
Home > Databoxes > Using a Databox - Conditional Assessments
+
As well as reading from a databox with the intention of writing the data to another location, you can also assess the data and use this to control the path that the script follows or perform some calculation.
  
Using a Databox - Conditional Assessments
+
When creating a databox it is possible to define a conditional assessment against the values that will be stored in that databox. A conditional assessment uses an expression, so that the data is assessed against that expression and will return either '''True''' or '''False'''. To make an expression conditional, make sure the tick is visible in the '''Cond?''' column.
  
As well as reading from a Databox (with the intention of writing the data to another location) you can also assess the data in a Databox and use this to control the path that the Script follows.
+
[[File:conditionalexample41.png]]
 +
 +
'''Example:''' Check if a quantity entered(in this example of a repair to wall tiles) is more than 10.
  
When creating a Databox it is possible to define a Conditional Assessment against the Databox. A Conditional Assessment uses an Expression, so that the data is assessed against the conditional expression to determine a subsequent action. The 'Cond?' conditional flag toggles directly between checked and unchecked, so when an Expression is created, the ‘Cond?’ box must be ticked to make it conditional:
+
With the script in edit mode, select the '''Databox - Read''' option from the item type drop down list in the navigation pane. Click the arrow next to the '''Check Quantity''' Databox to reveal the available expressions under it. Drag the ‘More than 10’ option across to the required position in the Script. This will add an Assessment to the Script and will also include an ‘Otherwise’ option.This allows you to adjust the path of the Script; depending on whether the quantity is greater than 10. If the content is less than 10, the ‘Otherwise’ path will be taken.
 
Example: This example uses an existing Databox which includes an expression that checks if a quantity (in this example of a repair to wall tiles) is more than 10.
 
  
The Databox is displayed in the Navigation Pane of the Script editor screen as a Databox – Read, and contains an extra level beneath it.
+
The question "How many wall tiles are affected?" prompts the user to enter a number. This value is written into the '''Script.Check quantity''' databox. If the "More than 10?" expression is true then an inspection code INSP is picked up. Otherwise there are more questions to answer. Once this is complete '''Script.Check quantity''' is read and the value written into '''Export.Quantity''' to pass back the number of tiles affected.
 
To use this Databox as a Conditional Assessment, open the Script in Edit mode and select the Databox - Read option from the Item Type drop down list in the Navigation Pane. Open the ‘Quantity’ Databox and drag the ‘More than 10’ option across to the required position in the Script. This will add an Assessment to the Script and will also include an ‘Otherwise’ option.
 
 
This allows you to adjust the path of the Script; depending on whether the quantity is greater than 10. If the content is less than 10, the ‘Otherwise’ path will be taken.
 
  
 +
[[File:quantittyexample41.png]]
  
Tip
+
[[File:exportreadexample41.png]]
  
If for any reason the assessment of the data fails the ‘Otherwise’ path will be automatically taken.
+
If for any reason the assessment of the data fails the ‘Otherwise’ path will be automatically taken.

Latest revision as of 15:21, 21 February 2018

As well as reading from a databox with the intention of writing the data to another location, you can also assess the data and use this to control the path that the script follows or perform some calculation.

When creating a databox it is possible to define a conditional assessment against the values that will be stored in that databox. A conditional assessment uses an expression, so that the data is assessed against that expression and will return either True or False. To make an expression conditional, make sure the tick is visible in the Cond? column.

Conditionalexample41.png

Example: Check if a quantity entered(in this example of a repair to wall tiles) is more than 10.

With the script in edit mode, select the Databox - Read option from the item type drop down list in the navigation pane. Click the arrow next to the Check Quantity Databox to reveal the available expressions under it. Drag the ‘More than 10’ option across to the required position in the Script. This will add an Assessment to the Script and will also include an ‘Otherwise’ option.This allows you to adjust the path of the Script; depending on whether the quantity is greater than 10. If the content is less than 10, the ‘Otherwise’ path will be taken.

The question "How many wall tiles are affected?" prompts the user to enter a number. This value is written into the Script.Check quantity databox. If the "More than 10?" expression is true then an inspection code INSP is picked up. Otherwise there are more questions to answer. Once this is complete Script.Check quantity is read and the value written into Export.Quantity to pass back the number of tiles affected.

Quantittyexample41.png

Exportreadexample41.png

If for any reason the assessment of the data fails the ‘Otherwise’ path will be automatically taken.