Difference between revisions of "Expressions"

From Keyfax Wiki
Jump to: navigation, search
(Created page with "Home > Databoxes > Using a Databox - Expressions Using a Databox - Expressions When using Databoxes within a Script you may wish to manipulate the data in the Databox, combi...")
 
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
Home > Databoxes > Using a Databox - Expressions
+
==Expressions==
 
+
When using databoxes within a Script you may wish to manipulate the data in the databox, combine it with data from another databox, or perform a conditional assessment on the data to decide which path in the script to take.
Using a Databox - Expressions
 
 
 
When using Databoxes within a Script you may wish to manipulate the data in the Databox, combine it with data from another Databox, or perform a Conditional Assessment on the data to decide which path in the Script to take.
 
  
 
Each of these actions is performed by defining an Expression against the relevant Databox that will manipulate the data within it.
 
Each of these actions is performed by defining an Expression against the relevant Databox that will manipulate the data within it.
  
 +
A full list of expressions used in Keyfax Inter•View can be found in [[Admin_Tools_Manual#Databox_Expressions|Databox Expressions]].
  
Tip
+
An Expression can be written as either a '''Transformation''' or a '''Logical Assessment'''.
 
 
A full list of Expressions used in Keyfax Inter•View can be found in here.
 
 
 
An Expression can be written as either a Transformation or a Logical Assessment.
 
 
 
Transformation Expressions
 
 
 
Transformation Expressions re-format the data within the Databox. These are usually used when the core data stored in the Databox needs to be pulled out in a different format or when the data needs to be mathematically manipulated.
 
 
 
Examples of a Transformation are:
 
•Reading the value of text in a Databox and putting it in UPPERCASE.
 
•Multiplying the data in a Databox.
 
•Reading only the first 3 characters of the data held in a Databox.
 
•Reading the contents of a Databox and then adding it to the value held in another Databox.
 
  
Logical Assessment Expressions
+
===Transformation Expressions===
 +
Transformation expressions re-format the data within the databox. These are usually used when the core data stored in the databox needs to be pulled out in a different format or when the data needs to be mathematically manipulated.
  
A Logical Assessment (Conditional) Expression assesses the data within a Databox. The Expression used in a Logical Assessment should return a True or False value. The outcome of the Expression is used to control which path in the Scripts is taken.
+
Examples of a transformation are:
 +
*Reading the value of text in a databox and putting it in UPPERCASE.
 +
*Multiplying the data in a databox.
 +
*Reading only the first 3 characters of the data held in a databox.
 +
*Reading the contents of a databox and then adding it to the value held in another databox.
  
Examples of a Logical Assessment are:
+
===Logical Assessment Expressions===
•Taking a particular path in a Script if a Databox value is greater than 10. If it is not greater than 10 then a different path is taken, as shown above.
 
•Changing the Script Set to be used if the user is set-up in a particular business group- this would be based on the information based in the import XML
 
•Taking a particular path in a Script if the date is between the beginning of April and the end of November, for example winter months may increase the priority of some repairs.
 
  
Defining an Expression
+
A logical assessment (conditional) expression assesses the data within a databox. The expression used in a logical assessment should return a '''True''' or '''False''' value.
  
Expressions are defined by editing the properties of the relevant Databox.
+
Examples of a logical assessment are:
 +
*Taking a particular path in a script if a databox value is greater than 10. If it is not greater than 10 then a different path is taken, as shown above.
 +
*Changing the script set to be used if the user is set-up in a particular business group, this would be based on the information based in the import XML
 +
*Taking a particular path in a script if the date is between the beginning of April and the end of November, for example winter months may increase the priority of some repairs.
  
Click on the  button to add a new Expression.
+
==Defining an Expression==
  
This presents a new Expression line that needs to be defined:
+
Expressions are defined by editing the properties of the relevant Databox. Click on the plus button to add a new expression. This presents a new expression line that needs to be defined:
 
Title – The Title for the Expression. The 'Tab' key can be used to navigate between cells.
 
 
 
Value – The Expression to be applied to the data in the Databox. The 'Tab' key can be used to navigate between cells.
 
 
 
Cond? – This check box specifies whether the Expression is to be a Logical Assessment (Conditional) or a Transformation. If the check box is ticked, the expression is a Logical Assessment (Conditional) Expression. If it is un-ticked, the expression is a Transformation Expression. The box toggles directly between a checked and unchecked state, after it is initially set.
 
 
 
 
 
Tip
 
 
 
The Cond? check box needs to be set up in order to save an Expression. It cannot be left as its default setting. The Cond? check box can NOT be changed if the expression is still referenced by existing Scripts.
 
 
 
To remove an Expression from the Databox, selected the Expression and click on the button once.
 
 
 
 
 
Tip
 
 
 
The removal of an Expression can only be undertaken if it is not referenced in any existing Scripts. You must also be logged in to the administration console as Exclusive Login.
 
 
 
Creating a Basic Transformation Expression
 
 
 
The creation of an Expression uses a series of Functions and Operators that are similar (but not exactly the same) to those used in spreadsheet applications to manipulate data.
 
 
 
Examples of where Operators may be used on a value of X are:
 
 
 
X * 8
 
X /10
 
(X * 5) / 6
 
X + 7
 
 
 
In addition functions may be used to convert and manipulate the data. The following example converts the text held in the Databox X to UPPERCASE:
 
 
 
Upper(X)
 
 
 
 
 
Tip
 
 
 
A full list of Expressions and Functions used in Keyfax Inter•View, with examples, can be found in Section 7.
 
 
 
When creating an Expression against a Databox, the value held in the Databox is automatically used as the first part of the expression and does not need to be identified.
 
 
 
For example to create a Transformation Expression that will convert the value of the Databox to UPPERCASE would be written as follows:
 
 
When dealing with Numerical Operators such as * / +, the contents of the Databox will need to be converted to a Number using the function Number().
 
  
This would be used (in context) as follows:
+
[[File:definingexpression41.png]]
 
   
 
   
 +
*'''Title''' – The Title for the Expression. The 'Tab' key can be used to navigate between cells.
  
Tip
+
*'''Value''' – The Expression to be applied to the data in the Databox. The 'Tab' key can be used to navigate between cells.
  
Any Databoxes used in a numerical calculation will need to be converted into a Number in order for the expression to function correctly.
+
*'''Cond?''' – This check box specifies whether the Expression is to be a Logical Assessment (Conditional) or a Transformation. If the check box is ticked, the expression is a Logical Assessment (Conditional) Expression. If it is un-ticked, the expression is a Transformation Expression. The box toggles directly between a checked and unchecked state, after it is initially set.
  
Creating a Basic Logical Assessment Expression
+
The Cond? check box needs to be set up in order to save an expression. It cannot be left as its default setting. The Cond? check box can NOT be changed if the expression is still referenced by existing scripts.
  
When creating a Logical Assessment (Conditional) Expression, you must ensure that the ‘Value’ field contains an Expression that will return a TRUE or FALSE value.
+
To remove an expression from the databox, selected the expression and click on the delete button once.
  
Examples of such Expressions are:
+
The removal of an Expression can only be undertaken if it is not referenced in any existing Scripts. You must also be logged in to the administration console as Exclusive Login.
Number() > 10
 
Number() = 5
 
= ‘Hello’
 
= {Script.Details}
 
  
When creating the relevant expression, you must ensure that the ‘Cond?’ check box is ticked.
 
  
  
 
 

Latest revision as of 12:18, 22 February 2018

Expressions

When using databoxes within a Script you may wish to manipulate the data in the databox, combine it with data from another databox, or perform a conditional assessment on the data to decide which path in the script to take.

Each of these actions is performed by defining an Expression against the relevant Databox that will manipulate the data within it.

A full list of expressions used in Keyfax Inter•View can be found in Databox Expressions.

An Expression can be written as either a Transformation or a Logical Assessment.

Transformation Expressions

Transformation expressions re-format the data within the databox. These are usually used when the core data stored in the databox needs to be pulled out in a different format or when the data needs to be mathematically manipulated.

Examples of a transformation are:

  • Reading the value of text in a databox and putting it in UPPERCASE.
  • Multiplying the data in a databox.
  • Reading only the first 3 characters of the data held in a databox.
  • Reading the contents of a databox and then adding it to the value held in another databox.

Logical Assessment Expressions

A logical assessment (conditional) expression assesses the data within a databox. The expression used in a logical assessment should return a True or False value.

Examples of a logical assessment are:

  • Taking a particular path in a script if a databox value is greater than 10. If it is not greater than 10 then a different path is taken, as shown above.
  • Changing the script set to be used if the user is set-up in a particular business group, this would be based on the information based in the import XML
  • Taking a particular path in a script if the date is between the beginning of April and the end of November, for example winter months may increase the priority of some repairs.

Defining an Expression

Expressions are defined by editing the properties of the relevant Databox. Click on the plus button to add a new expression. This presents a new expression line that needs to be defined:

Definingexpression41.png

  • Title – The Title for the Expression. The 'Tab' key can be used to navigate between cells.
  • Value – The Expression to be applied to the data in the Databox. The 'Tab' key can be used to navigate between cells.
  • Cond? – This check box specifies whether the Expression is to be a Logical Assessment (Conditional) or a Transformation. If the check box is ticked, the expression is a Logical Assessment (Conditional) Expression. If it is un-ticked, the expression is a Transformation Expression. The box toggles directly between a checked and unchecked state, after it is initially set.
The Cond? check box needs to be set up in order to save an expression. It cannot be left as its default setting. The Cond? check box can NOT be changed if the expression is still referenced by existing scripts.

To remove an expression from the databox, selected the expression and click on the delete button once.

The removal of an Expression can only be undertaken if it is not referenced in any existing Scripts. You must also be logged in to the administration console as Exclusive Login.