Difference between revisions of "Text Expressions"

From Keyfax Wiki
Jump to: navigation, search
m
 
(3 intermediate revisions by the same user not shown)
Line 59: Line 59:
 
|"ABCABC"  
 
|"ABCABC"  
 
|"AXCAXC"  
 
|"AXCAXC"  
|Replace all occurrences of first value ('B') with second value ('X')
+
|Replace all occurrences of first value ('B') with second value ('X'). Note that the 'Replace' expression is case sensitive.
 
|-
 
|-
 
|Substr(4,2)
 
|Substr(4,2)
 
|123456789
 
|123456789
 
|45
 
|45
|1st character = 1
+
|This expression returns part of a string of characters. Note that counting is 1-based, i.e. 1st character = 1
 
|-
 
|-
 
|Trim
 
|Trim

Latest revision as of 11:30, 6 April 2018

Text Expressions
Expression Databox Value Result Comments
CSV(2) line1, line2, line3 line2 Will return the specified section from within a CSV; (2) = 2nd entry (line2) Returns "" if entry is invalid.
Entry(2, ";") line1; line2; line3 line2 Entry n (1-based) from list Returns "" if invalid entry.
Exists "any text" True False if Value is Empty/Blank
Index(" line2",",") line1, line2, line3 2 Index (1-based) index of entry in list Returns 0 if not in list. Note: exact match required e.g. text case and spaces
Inlist("A,B,C", ",") A or B or C True True if text is in list. Note: exact match required e.g. text case and spaces
Item("Name") Keyfax address Databox Name item from address Item returns a named item from a multi-value Databox such as an Address or an SQL data source returning multiple columns where individual column values are returned using the column name e.g. Item("colName")
Len "characters" 10 Measures the number of characters used within the Databox Value
ListTidy(";") ";B;;D;" "B;D" Removes leading, trailing and duplicated occurrences of the given 'separator'
Lower NAME name Changes an uppercase Value to lowercase
PadLeft(7, " ") "12" " 12" Places an Indent to the left of the Value
Replace('B','X') "ABCABC" "AXCAXC" Replace all occurrences of first value ('B') with second value ('X'). Note that the 'Replace' expression is case sensitive.
Substr(4,2) 123456789 45 This expression returns part of a string of characters. Note that counting is 1-based, i.e. 1st character = 1
Trim " text " "text" Trims the Value of any spaces
Upper name NAME Changes a lowercase Value to uppercase
WCase name Name Changes the start of the Value to uppercase