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.
This page is the index: every function on that page, by the alphabet.
The form#
A function wraps the text it works on:
{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 |
add |
add:n |
adds a whole number | {add_start:500}1000{add_end} |
1500 |
Numbers |
add_list |
add_list |
adds the item in hand to a kept list | Only in the UserVariable task | ||
base64 |
base64 |
the text as Base64 | 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 | |
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 | ||
chop |
chop |
the path without its last part | {chop_start}/a/b/c/{chop_end} |
/a/b/ |
Paths and addresses |
decode |
encode, decode |
writes a text the way an address needs it (%20 for a space), and back |
Paths and addresses | ||
decrement |
increment, decrement |
one more, one less | {increment_start}50{increment_end} |
51 |
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 | |
encode |
encode, decode |
writes a text the way an address needs it (%20 for a space), and back |
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 | |
geoip |
geoip |
looks up where an IP address is: {geoip_start}{user_ip}{geoip_end} |
the lookup service set up in the Preferences | 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 | |
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 | ||
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 | ||
increment |
increment, decrement |
one more, one less | {increment_start}50{increment_end} |
51 |
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 |
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 | ||
last |
last |
the last part of a path | {last_start}/a/b/file.txt{last_end} |
file.txt |
Paths and addresses |
length |
length |
the number of characters | {length_start}blah{length_end} |
4 |
Text |
load_list |
load_list |
replaces the list of items with a kept one | Only in the UserVariable task | ||
log |
log |
writes the text into the server's log | Functions that need a right, or a setting | ||
lower |
upper, lower |
capitals, small letters | {lower_start}Report.PDF{lower_end} |
report.pdf |
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 |
md5 |
md5 |
the MD5 checksum of the text, as MD5: and the value |
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 | |
properties_parse |
properties_parse |
the same for lines of name=value |
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 |
rparse |
rparse:format |
the other way: milliseconds as a date in the given format | {rparse_start:yyyy-MM-dd}{time}{rparse_end} |
Dates | |
save_list |
save_list |
keeps a copy of the list of items under a name | 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 |
sql |
sql |
makes a value safe to put into an SQL statement: quotes and percent signs become _, a semicolon a space |
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 |
trim |
trim |
takes spaces off both ends | Text | ||
upper |
upper, lower |
capitals, small letters | {lower_start}Report.PDF{lower_end} |
report.pdf |
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 |
verifycontains |
verifycontains:a;b |
true when the text holds one of the given texts |
{verifycontains_start:.csv;.txt}{name}{verifycontains_end} |
true |
Text |
vrldecode |
vrlencode, vrldecode |
the same for a user name or password inside an address ({at} for @) |
Paths and addresses | ||
vrlencode |
vrlencode, vrldecode |
the same for a user name or password inside an address ({at} for @) |
Paths and addresses | ||
xml_decode |
xml_encode, xml_decode |
writes <, > and & the way XML needs them, and back |
Encoding and checks | ||
xml_encode |
xml_encode, xml_decode |
writes <, > and & the way XML needs them, and back |
Encoding and checks | ||
xml_parse |
xml_parse |
the same for XML | 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. For which role may use which, see The permission catalog.
- Order. Functions inside functions are worked out from the inside: The order.
- Try one before you rely on it: 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.