> For the complete documentation index, see [llms.txt](https://docs.keyfax.biz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.keyfax.biz/product-suite/admin/databox-expressions/additional-functions.md).

# Additional Functions

### 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.&#x20;

Currently there is only 1 transformation designed to work with the XML returned from the **Services System Values Databox**.&#x20;

```
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.

<div align="center"><figure><img src="/files/G16U5KAD4ehVxxNVjLUz" alt=""><figcaption></figcaption></figure></div>

This can handle an additional Standard Minute Value (SMV) column if appropriate.&#x20;

{% hint style="warning" %}
**IMPORTANT** Any changes in this area must be configured by Omfax Systems 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.
{% endhint %}

### Date Functions

The following operate independently of the Databox value. They can only be used as a parameter to another function or after an [operator](/product-suite/admin/databox-expressions/operators-and-literals.md).

| 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          |

### ds (Datasource)

The `ds` expression function is useful for when you want to use the value of a databox multiple times in one expression. Please see [Ds](/product-suite/admin/databox-expressions/additional-functions/ds.md).

### Numeric Functions

| Function |             Sample Expression            | DataBox Value | Result | Comments                                |
| :------: | :--------------------------------------: | :-----------: | :----: | --------------------------------------- |
|    `%`   |                 12 + 10%                 |               |  13.20 | Add n% of original value                |
|   `Rnd`  | <p>Number + Rnd format("F4")<br><br></p> |       1       | 0.8946 | Returns a random number between 0 and 1 |

### Text Functions

|     Function    |              Sample Expression             |       Databox Value       | Result                                       |                                                                                                                                         |
| :-------------: | :----------------------------------------: | :-----------------------: | -------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
|      `ChCR`     |             Replace(", ", ChCR)            |       "Hello, world"      | <p>Hello<br>world</p>                        | The example replaces a comma followed by a space with a Carriage Return character                                                       |
|     `ChCRLF`    |            Replace(", ", ChCRLF)           |  "line 1, line 2, line 3  | <p>line 1<br>line 2<br>line 3</p>            | Replace comma and space with Carriage Return and Line Feed characters                                                                   |
|      `ChLF`     |  <p>Replace(", ", ChLF)      <br><br></p>  | <p>"Hello, world"<br></p> | <p>Hello<br>world</p>                        | <p>The example replaces a comma followed by a space with a Line Feed character<br></p>                                                  |
|       `ds`      |  <p>Replace(ds, 'Hello ') + ds<br><br></p> |          "world"          | Hello world                                  | This replaces the initial value with a prefix (‘Hello’) and then appends the initial value. ‘ds’ represents the original DataBox Value. |
| `HtmlLineBreak` | <p>Replace(",", HtmlLineBreak)<br><br></p> |  "line 1, line 2, line 3  | <p>line1\<br/> line2\<br/> line3<br><br></p> | <p>Html "\<br/>" text<br></p>                                                                                                           |
