# Task functions

A function changes a value inside a field of a task: makes it lower case, cuts a piece out, adds to a number, turns a time into another form. How they are written and combined, with the rules, is in [Functions](Jobs-Functions.md).

This page is the index: every function on that page, by the alphabet.

## The form

A function wraps the text it works on:

```text
{lower_start}Report.PDF{lower_end}
```

gives `report.pdf`. A function that needs to be told something takes it after a colon in the opening part: `{replace_start:a:b}…{replace_end}`. What is inside can hold variables, and other functions.

## The functions

| Function | Written | Does | Example | Gives | Kind |
|---|---|---|---|---|---|
| `1char` | `1char` | takes the last character off | `{1char_start}a,b,c,{1char_end}` | `a,b,c` | [Text](Jobs-Functions.md#text) |
| `add` | `add:n` | adds a whole number | `{add_start:500}1000{add_end}` | `1500` | [Numbers](Jobs-Functions.md#numbers) |
| `add_list` | `add_list` | adds the item in hand to a kept list |  |  | [Only in the UserVariable task](Jobs-Functions.md#only-in-the-uservariable-task) |
| `base64` | `base64` | the text as Base64 |  |  | [Encoding and checks](Jobs-Functions.md#encoding-and-checks) |
| `base64url` | `base64url` | fetches what is at an address and gives it as Base64, for a picture in a mail | the server settings `base64url_allowed_url_patterns` (which addresses) and `base64url_fetch_max_size` |  | [Functions that need a right, or a setting](Jobs-Functions.md#functions-that-need-a-right-or-a-setting) |
| `checkemail` | `checkemail:domains` | `true` when every address in the text is at one of the given domains: `{checkemail_start:example.com;example.org}{to}{checkemail_end}` |  |  | [Encoding and checks](Jobs-Functions.md#encoding-and-checks) |
| `chop` | `chop` | the path without its last part | `{chop_start}/a/b/c/{chop_end}` | `/a/b/` | [Paths and addresses](Jobs-Functions.md#paths-and-addresses) |
| `decode` | `encode`, `decode` | writes a text the way an address needs it (`%20` for a space), and back |  |  | [Paths and addresses](Jobs-Functions.md#paths-and-addresses) |
| `decrement` | `increment`, `decrement` | one more, one less | `{increment_start}50{increment_end}` | `51` | [Numbers](Jobs-Functions.md#numbers) |
| `decrypt` | `encrypt`, `decrypt` | encrypts a text with the server's own key, and back | the right to use the server's keys |  | [Functions that need a right, or a setting](Jobs-Functions.md#functions-that-need-a-right-or-a-setting) |
| `encode` | `encode`, `decode` | writes a text the way an address needs it (`%20` for a space), and back |  |  | [Paths and addresses](Jobs-Functions.md#paths-and-addresses) |
| `encrypt` | `encrypt`, `decrypt` | encrypts a text with the server's own key, and back | the right to use the server's keys |  | [Functions that need a right, or a setting](Jobs-Functions.md#functions-that-need-a-right-or-a-setting) |
| `geoip` | `geoip` | looks up where an IP address is: `{geoip_start}{user_ip}{geoip_end}` | the lookup service set up in the [Preferences](Prefs.md) |  | [Functions that need a right, or a setting](Jobs-Functions.md#functions-that-need-a-right-or-a-setting) |
| `group` | `group:property:group of users:separator` | one property of every member of a group, as a list: `{group_start:email:MainUsers:,}Sales{group_end}` gives the mail addresses of the group Sales | the right to see those users |  | [Functions that need a right, or a setting](Jobs-Functions.md#functions-that-need-a-right-or-a-setting) |
| `htmlclean` | `htmlclean`, `htmlclean2` | takes the HTML tags out of a text, in two ways. For putting the text of an HTML mail into a plain file. |  |  | [Encoding and checks](Jobs-Functions.md#encoding-and-checks) |
| `htmlclean2` | `htmlclean`, `htmlclean2` | takes the HTML tags out of a text, in two ways. For putting the text of an HTML mail into a plain file. |  |  | [Encoding and checks](Jobs-Functions.md#encoding-and-checks) |
| `increment` | `increment`, `decrement` | one more, one less | `{increment_start}50{increment_end}` | `51` | [Numbers](Jobs-Functions.md#numbers) |
| `indexof` | `indexof:text:from` | where a text is found, counted from 0; -1 when it is not there. A negative "from" searches backwards from the end. | `{indexof_start:thing:0}something{indexof_end}` | `4` | [Text](Jobs-Functions.md#text) |
| `json_parse` | `json_parse` | reads a JSON text and makes a variable of each of its values: `{json_parse_start}{body}{json_parse_end}`, then `{status}` for the value named status. One level only. |  |  | [Only in the UserVariable task](Jobs-Functions.md#only-in-the-uservariable-task) |
| `last` | `last` | the last part of a path | `{last_start}/a/b/file.txt{last_end}` | `file.txt` | [Paths and addresses](Jobs-Functions.md#paths-and-addresses) |
| `length` | `length` | the number of characters | `{length_start}blah{length_end}` | `4` | [Text](Jobs-Functions.md#text) |
| `load_list` | `load_list` | replaces the list of items with a kept one |  |  | [Only in the UserVariable task](Jobs-Functions.md#only-in-the-uservariable-task) |
| `log` | `log` | writes the text into the server's log |  |  | [Functions that need a right, or a setting](Jobs-Functions.md#functions-that-need-a-right-or-a-setting) |
| `lower` | `upper`, `lower` | capitals, small letters | `{lower_start}Report.PDF{lower_end}` | `report.pdf` | [Text](Jobs-Functions.md#text) |
| `math` | `math:type` | works out a sum with `+ - * /`. The type is `i` whole number, `l` long whole number, `f` or `d` number with decimals; `d` if you give none. | `{math_start:l}5+5{math_end}` | `10` | [Numbers](Jobs-Functions.md#numbers) |
| `md5` | `md5` | the MD5 checksum of the text, as `MD5:` and the value |  |  | [Encoding and checks](Jobs-Functions.md#encoding-and-checks) |
| `parse` | `parse:format` | reads a date written in the given format and gives it as milliseconds | `{parse_start:MMddyy HH~..~mm~..~ss}042578 22:43:12{parse_end}` |  | [Dates](Jobs-Functions.md#dates) |
| `properties_parse` | `properties_parse` | the same for lines of `name=value` |  |  | [Only in the UserVariable task](Jobs-Functions.md#only-in-the-uservariable-task) |
| `replace` | `replace:a:b` | every `a` becomes `b` | `{replace_start:test:big_test}a_test{replace_end}` | `a_big_test` | [Text](Jobs-Functions.md#text) |
| `rparse` | `rparse:format` | the other way: milliseconds as a date in the given format | `{rparse_start:yyyy-MM-dd}{time}{rparse_end}` |  | [Dates](Jobs-Functions.md#dates) |
| `save_list` | `save_list` | keeps a copy of the list of items under a name |  |  | [Only in the UserVariable task](Jobs-Functions.md#only-in-the-uservariable-task) |
| `split` | `split:by:n` | cuts the text at a separator and gives piece number n, counted from 0 | `{split_start:_:3}this_is_a_test_for_split{split_end}` | `test` | [Text](Jobs-Functions.md#text) |
| `sql` | `sql` | makes a value safe to put into an SQL statement: quotes and percent signs become `_`, a semicolon a space |  |  | [Encoding and checks](Jobs-Functions.md#encoding-and-checks) |
| `substring` | `substring:from:to` | the characters from one place to another, counted from 0. A negative number counts from the end; `-1` as the second means "to the end". | `{substring_start:2:5}something{substring_end}` | `met` | [Text](Jobs-Functions.md#text) |
| `trim` | `trim` | takes spaces off both ends |  |  | [Text](Jobs-Functions.md#text) |
| `upper` | `upper`, `lower` | capitals, small letters | `{lower_start}Report.PDF{lower_end}` | `report.pdf` | [Text](Jobs-Functions.md#text) |
| `url` | `url:part` | one part of an address: `protocol`, `user`, `pass`, `host`, `port`, `path`, `file` or `query` | `{url_start:host}sftp://alex@files.example.com/in/a.txt{url_end}` | `files.example.com` | [Paths and addresses](Jobs-Functions.md#paths-and-addresses) |
| `verifycontains` | `verifycontains:a;b` | `true` when the text holds one of the given texts | `{verifycontains_start:.csv;.txt}{name}{verifycontains_end}` | `true` | [Text](Jobs-Functions.md#text) |
| `vrldecode` | `vrlencode`, `vrldecode` | the same for a user name or password inside an address (`{at}` for @) |  |  | [Paths and addresses](Jobs-Functions.md#paths-and-addresses) |
| `vrlencode` | `vrlencode`, `vrldecode` | the same for a user name or password inside an address (`{at}` for @) |  |  | [Paths and addresses](Jobs-Functions.md#paths-and-addresses) |
| `xml_decode` | `xml_encode`, `xml_decode` | writes `<`, `>` and `&` the way XML needs them, and back |  |  | [Encoding and checks](Jobs-Functions.md#encoding-and-checks) |
| `xml_encode` | `xml_encode`, `xml_decode` | writes `<`, `>` and `&` the way XML needs them, and back |  |  | [Encoding and checks](Jobs-Functions.md#encoding-and-checks) |
| `xml_parse` | `xml_parse` | the same for XML |  |  | [Only in the UserVariable task](Jobs-Functions.md#only-in-the-uservariable-task) |

43 functions.

## Things to know

- **Some functions need a right or a setting**: those that read the server's data or reach outside it are listed under [Functions that need a right, or a setting](Jobs-Functions.md#functions-that-need-a-right-or-a-setting). For which role may use which, see [The permission catalog](Ref-Permissions.md).
- **Order.** Functions inside functions are worked out from the inside: [The order](Jobs-Functions.md#the-order).
- **Try one before you rely on it**: [Trying one](Jobs-Functions.md#trying-one).

## Where this list comes from

The index is built from the functions page of this wiki, which was written against the server's code and tried on a test server where it says so.
