Difference between revisions of "Additional Functions"

From Keyfax Wiki
Jump to: navigation, search
 
(6 intermediate revisions by the same user not shown)
Line 29: Line 29:
  
 
{| class="wikitable"
 
{| class="wikitable"
|+ Date Functions
+
|+ style="text-align:left;" | Date Functions
 
!Function
 
!Function
 
!Sample Expression
 
!Sample Expression
Line 50: Line 50:
  
 
{| class="wikitable"
 
{| class="wikitable"
|+ Numeric Functions
+
|+ style="text-align:left;" | Numeric Functions
 
!Function
 
!Function
 
!Sample Expression
 
!Sample Expression
Line 68: Line 68:
 
|13.20
 
|13.20
 
|Add n% of original value
 
|Add n% of original value
||-
+
|-
 
|Rnd
 
|Rnd
 
|Number + Rnd format("F4")
 
|Number + Rnd format("F4")
Line 77: Line 77:
  
 
{| class="wikitable"
 
{| class="wikitable"
|+ Text Functions
+
|+ style="text-align:left;" | Text Functions
 
!Function
 
!Function
 
!Sample Expression
 
!Sample Expression
Line 88: Line 88:
 
|"Hello, world"
 
|"Hello, world"
 
|Hello
 
|Hello
world
+
world
 
|The example replaces a comma followed by a space with a Carriage Return character
 
|The example replaces a comma followed by a space with a Carriage Return character
 
|-
 
|-
Line 95: Line 95:
 
|"line 1, line 2, line 3
 
|"line 1, line 2, line 3
 
|line 1
 
|line 1
line 2
+
line 2
line 3
+
 
 +
line 3
 
|Replace comma and space with Carriage Return and Line Feed characters
 
|Replace comma and space with Carriage Return and Line Feed characters
 
|-
 
|-
Line 108: Line 109:
 
|HtmlLineBreak
 
|HtmlLineBreak
 
|Replace(",", HtmlLineBreak)
 
|Replace(",", HtmlLineBreak)
|"line 1, line 2, line 3
+
|"line 1, line 2, line 3"
|line1<br/> line2<br/> line3
+
|line1<nowiki><br/></nowiki> line2<nowiki><br/></nowiki> line3
|Html "<br/>" text
+
|Html "<nowiki><br/></nowiki>" text
 
|}
 
|}

Latest revision as of 12:24, 28 February 2018

Transform

This should only be called on a databox containing XML data and applies a pre-defined transformation to generate a display friendly presentation of the XML data. Currently there is only one transformation designed to work with the XML returned from the services system values databox.

Transform('Transform/Services.xsl')

Use this with a 'Services' system values databox to format details of all services recorded in a script into an HTML table for inclusion in an email.

Code Description Priority Quantity Unit Complete by
Exp01 SOR with cost 3 1 N/A 01/11/2018 14:00:00

This can handle an additional Standard Minute Value (SMV) column if appropriate. Any changes in this area must be configured by Omfax to ensure the SMV is included in the Services export (e.g. using Services2SMV template), the SMV heading text is defined in TransformServicesStandardMinuteValue and this element is included in TransformServicesElements in the language text.

Other Functions

The following operate independently of the Databox value. They can only be used as a parameter to another function or after an operator.

Date Functions
Function Sample Expression DataBox Value Result Comments
Now &Format(Now,”dd MMM yyyy – HH:mm”) 01 April 2010 – 09:00 Returns the present Date and Time
Today &Format(Today, “MMM yyyy”) April 2010 Returns the present Date
Numeric Functions
Function Sample Expression DataBox Value Result Comments
ds Number * Number(ds) 3 9 ‘ds’ represents the original DataBox Value. In this example 3x3 = 9
% 12 + 10% 13.20 Add n% of original value
Rnd Number + Rnd format("F4") 1 0.8946 Returns a random number between 0 and 1
Text Functions
Function Sample Expression DataBox Value Result Comments
ChCR Replace(", ", ChCR) "Hello, world" Hello

world

The example replaces a comma followed by a space with a Carriage Return character
ChCRLF Replace(", ", ChCRLF) "line 1, line 2, line 3 line 1

line 2

line 3

Replace comma and space with Carriage Return and Line Feed characters
ChLF Replace(", ", ChLF) "Hello, world" Hello

world

The example replaces a comma followed by a space with a Line Feed character
HtmlLineBreak Replace(",", HtmlLineBreak) "line 1, line 2, line 3" line1<br/> line2<br/> line3 Html "<br/>" text