---
title: "Functions and Formulae"
url: "https://help.formsfly.com/en/article/functions-and-formulae"
language: "en"
last_updated: "2025-05-16T11:45:59.174Z"
---

# Functions and Formulae

Below is a comprehensive list of FormsFly formula functions that can be used in various field properties throughout the platform wherever the hammer icon is present.

| **NOTE:** Functions names are not case-sensitive. |
| --- |

| **1\.** [**Contextual**](https://help.formsfly.com/en/article/functions-and-formulae#1.-contextual) | **8.** [**Choices**](https://help.formsfly.com/en/article/functions-and-formulae#8.-choices) |
| --- | --- |
| **2.** [**System Values**](https://help.formsfly.com/en/article/functions-and-formulae#2.-system-values) | **9\.** [**Repeats/Tables**](https://help.formsfly.com/en/article/functions-and-formulae#9.-repeats/tables) |
| **3.** [**Maths**](https://help.formsfly.com/en/article/functions-and-formulae#3.-maths) | **10.** [**Lists/Sets of Values**](https://help.formsfly.com/en/article/functions-and-formulae#10.-lists/sets-of-values) |
| **4.** [**Text/String**](https://help.formsfly.com/en/article/functions-and-formulae#4.-text/string) | **11\.** [**Data Sources**](https://help.formsfly.com/en/article/functions-and-formulae#11.-data-sources) |
| **5\.** [**Date/Time**](https://help.formsfly.com/en/article/functions-and-formulae#5.-date/time) | **12\.** [**Location**](https://help.formsfly.com/en/article/functions-and-formulae#12.-location) |
| **6.** [**Logic**](https://help.formsfly.com/en/article/functions-and-formulae#6.-logic) | **13\.** [**Data Interchange**](https://help.formsfly.com/en/article/functions-and-formulae#13.-data-interchange) |
| **7.** [**Data Conversion**](https://help.formsfly.com/en/article/functions-and-formulae#7.-data-conversion) | **14\.** [**Process Steps**](https://help.formsfly.com/en/article/functions-and-formulae#14.-process-steps) |

### ***1\. Contextual***

| **Purpose** | **Function** |
| --- | --- |
| User's Email Address | [USEREMAIL()](https://help.formsfly.com/en/article/useremail) |
| User's First Name | [USERFIRSTNAME()](https://help.formsfly.com/en/article/userfirstname) |
| User's Last Name | [USERLASTNAME()](https://help.formsfly.com/en/article/userlastname) |
| User's External Id | [USEREXTERNALID()](https://help.formsfly.com/en/article/userexternalid) |
| Value Matches Current User | [USERINGROUP()](https://help.formsfly.com/en/article/useringroup) |
| Organisation Name | [ORGNAME()](https://help.formsfly.com/en/article/orgname) |
| Global Value | [GLOBALVAL('keyname')](https://help.formsfly.com/en/article/globalval) |
| Organisation Meta Value | [ORGMETA('key')](https://help.formsfly.com/en/article/orgmeta) |
| User Meta Value | [USERMETA('key')](https://help.formsfly.com/en/article/usermeta) |
| Device Name | [DEVICENAME()](https://help.formsfly.com/en/article/devicename) |
| Operating System Name | [DEVICEOS()](https://help.formsfly.com/en/article/deviceos) |
| Operating System Version | [DEVICEOSVERSION()](https://help.formsfly.com/en/article/deviceosversion) |
| Current App Version | [APPVERSION()](https://help.formsfly.com/en/article/appversion) |
| Current Screen Version | [SCREENVERSION()](https://help.formsfly.com/en/article/screenversion) |
| Screen Last Updated (UTC) | [SCREENDATE()](https://help.formsfly.com/en/article/screendate) |
| Direct Value | [VAL('dataname')](https://help.formsfly.com/en/article/val) |
| Screen Parameter | [COUNTER()](https://help.formsfly.com/en/article/counter) |
| Linked Task Data - APP ONLY | [TASK('key')](https://help.formsfly.com/en/article/task) |
|  | [USERLANG()](https://help.formsfly.com/en/article/userlang) |

### ***2\. System Values***

| **Purpose** | **Function** |
| --- | --- |
| Current Date | [TODAY()](https://help.formsfly.com/en/article/today) |
| Current Date and Time | [NOW()](https://help.formsfly.com/en/article/now) |
| Current UTC (GMT) Date | [UTCTODAY()](https://help.formsfly.com/en/article/utctoday) |
| Current UTC (GMT) Date & Time | [UTCNOW()](https://help.formsfly.com/en/article/utcnow) |
|  | [TASK-FIRSTAVAILABLE()](https://help.formsfly.com/en/article/task-firstavailable) |
|  | [TASK-FIRSTTOCLAIM()](https://help.formsfly.com/en/article/task-firsttoclaim) |

### ***3\. Maths***

*You must put a space between mathematical operators.  e.g. **{{price1}}-{{price3}}** is not valid, but **{{price1}} - {{price3}}** is valid.*

| **Purpose** | **Function** |
| --- | --- |
| Add | [**+**](https://help.formsfly.com/en/article/add) |
| Subtract | [**\-**](https://help.formsfly.com/en/article/subtract) |
| Multiply | [**\***](https://help.formsfly.com/en/article/multiply) |
| Divide | [DIV](https://help.formsfly.com/en/article/divide) |
| Modulo | [MOD](https://help.formsfly.com/en/article/mod) |
| Rounding | [ROUND(value, decimals)](https://help.formsfly.com/en/article/round) |
| Maximum | [MAX(val1, val2)](https://help.formsfly.com/en/article/max) |
| Minimum | [MIN(val1, val2)](https://help.formsfly.com/en/article/min) |
| Truncate | [TRUNC(val)](https://help.formsfly.com/en/article/trunc) |
| Power | [POW(val, power)](https://help.formsfly.com/en/article/pow) |
| Floor | [FLOOR(val)](https://help.formsfly.com/en/article/floor) |
| Ceiling | [CEILING(val)](https://help.formsfly.com/en/article/ceiling) |
| Absolute | [ABS(val)](https://help.formsfly.com/en/article/abs) |
| Random Number | [RANDOM(length)](https://help.formsfly.com/en/article/random) |

### ***4\. Text/String***

| **Purpose** | **Function** |
| --- | --- |
| Join bits of text together | [CONCAT(value1, value2, ...)](https://help.formsfly.com/en/article/concat) |
| Get part of a piece of text | [SUBSTR(value, start)](https://help.formsfly.com/en/article/substr)<br>[SUBSTR(value, start, length)](https://help.formsfly.com/en/article/substr) |
| Length of a piece of text | [STRING-LENGTH(value)](https://help.formsfly.com/en/article/string-length) |
| Join values with a separator | [JOIN(separatorString, value1, value2, ...)](https://help.formsfly.com/en/article/join-string) |
| Substitute new text for old text | [SUBSTITUTE(val, old\_text, new\_text)](https://help.formsfly.com/en/article/substitute) |
| Lower Case | [LOWER(val)](https://help.formsfly.com/en/article/lower) |
| Upper Case | [UPPER(val)](https://help.formsfly.com/en/article/upper) |
| Starts With | [STARTSWITH(val, startswith)](https://help.formsfly.com/en/article/startswith) |
| Contains Text | [CONTAINS(val, contains)](https://help.formsfly.com/en/article/contains) |
| Index / Position of Text | [INDEXOF(input, value, optionalStartIndex, optionalCount)](https://help.formsfly.com/en/article/indexof) |
| Split String | [SPLIT(input, delimiter, optionalIndex)](https://help.formsfly.com/en/article/split) |
| Random String | [RANDOMSTR(length)](https://help.formsfly.com/en/article/randomstr) |
| GUID | [GUID()](https://help.formsfly.com/en/article/guid) |
| New Line Character | ["\\n"](https://help.formsfly.com/en/article//n) |

### ***5\. Date/Time***

| **Purpose** | **Function** |
| --- | --- |
| Add To Date | [DATEADD(startdate, numberunits, unit)](https://help.formsfly.com/en/article/dateadd) |
| Difference Between Dates | [DATEDIFF(startdate, enddate, unit)](https://help.formsfly.com/en/article/datediff) |
| Convert UTC Date to Local Date | [DATETOLOCAL](https://help.formsfly.com/en/article/datetolocal)    <br>[(utcdateval)](https://help.formsfly.com/en/article/datetolocal) |
| Convert Local Date to UTC Date | [DATETOUTC](https://help.formsfly.com/en/article/datetoutc)    <br>[(localdateval)](https://help.formsfly.com/en/article/datetoutc) |
| Year | [YEAR(dateval)](https://help.formsfly.com/en/article/year) |
| Month | [MONTH(dateval)](https://help.formsfly.com/en/article/month) |
| Day | [DAY(dateval)](https://help.formsfly.com/en/article/day) |
| Hour | [HOUR(dateval)](https://help.formsfly.com/en/article/hour) |
| Minute | [MINUTE(dateval)](https://help.formsfly.com/en/article/minute) |
| Second | [SECOND(dateval)](https://help.formsfly.com/en/article/second) |
| Day of Week | [DAYWEEK(dateval)](https://help.formsfly.com/en/article/dayweek) |
| Day of Year | [DAYYEAR(dateval)](https://help.formsfly.com/en/article/dayyear) |
| Week of Year | [WEEKYEAR(dateval)](https://help.formsfly.com/en/article/weekyear) |
| Creation Date / Time of Image | [IMGDATE(imagefield)](https://help.formsfly.com/en/article/imgdate) |

### ***6\. Logic***

| **Purpose** | **Function** |
| --- | --- |
| Not | [NOT(val)](https://help.formsfly.com/en/article/not) |
| And | [AND](https://help.formsfly.com/en/article/and) |
| Or | [OR](https://help.formsfly.com/en/article/or) |
| True | [TRUE()](https://help.formsfly.com/en/article/true) |
| False | [FALSE()](https://help.formsfly.com/en/article/false) |
| Equal to | [\=](https://help.formsfly.com/en/article/equal-to) |
| Greater than        <br>Greater than or equal | [**\>**](https://help.formsfly.com/en/article/greater-than)        <br>[**\>=**](https://help.formsfly.com/en/article/greater-than-or-equal) |
| Less than        <br>Less than or equal | [**<**](https://help.formsfly.com/en/article/less-than)        <br>[**<=**](https://help.formsfly.com/en/article/less-than-or-equal) |
| Conditional (if/else) | [IF(condition, trueval, falseval)](https://help.formsfly.com/en/article/if) |
| Is Blank or Empty | [ISBLANK(val)](https://help.formsfly.com/en/article/isblank) |
| Not Blank or Empty | [NOTBLANK(val)](https://help.formsfly.com/en/article/notblank) |
| First non-empty value | [COALESCE(val1, val2)](https://help.formsfly.com/en/article/coalesce) |
| Regularly used  expressions | [REGEX(input, pattern)](https://help.formsfly.com/en/article/regex) |
| Regular Expression Replacement | [REPLACE(input, pattern, replacement)](https://help.formsfly.com/en/article/replace) |

### ***7\. Data Conversion***

| **Purpose** | **Function** |
| --- | --- |
| Convert to number | [NUMBER(value)](https://help.formsfly.com/en/article/number) |
| Convert to string | [STRING(value)](https://help.formsfly.com/en/article/string) |
| Convert to date | [DATE(value)](https://help.formsfly.com/en/article/date) |
| Convert Date to text in a particular format | [FORMAT-DATE(value, format)](https://help.formsfly.com/en/article/format-date) |
| Format Number to Text | [FORMAT-NUM(val, format, optionalCulture)](https://help.formsfly.com/en/article/format-num) |
| Format Location to Text | [FORMAT-GEO(val, format)](https://help.formsfly.com/en/article/format-geo) |
| To Integer | [INT(val)](https://help.formsfly.com/en/article/int) |
| To Boolean | [BOOLEAN(val)](https://help.formsfly.com/en/article/boolean) |
| To CheckBox (Ticked or Crossed) | [CBOX(val, matchTo)](https://help.formsfly.com/en/article/cbox) |
| To CheckBox (Ticked or Blank) | [CBOXB(val, matchTo)](https://help.formsfly.com/en/article/cboxb) |
| To File URL | [FILEURL(fieldname)](https://help.formsfly.com/en/article/fileurl) |

### ***8\. Choices***

| **Purpose** | **Function** |
| --- | --- |
| Check if an answer is selected | [SELECTED(dataname, value)](https://help.formsfly.com/en/article/selected) |
| Count selected items | [COUNT-SELECTED(dataname)](https://help.formsfly.com/en/article/count-selected) |

### ***9\. Repeats/Tables***

| **Purpose** | **Function** |
| --- | --- |
| Repeat/Row Position | [POSITION({{repeat}})](https://help.formsfly.com/en/article/position) |
| Prior Repeat Values | [PRIOR('dataname', occurrences)](https://help.formsfly.com/en/article/prior) |
| Count no of repeats | [COUNT({{repeat}})](https://help.formsfly.com/en/article/count-repeat) |
| Add repeated values | [SUM({{numfield}})](https://help.formsfly.com/en/article/sum-repeat) |
| Average Repeat/Rows | [AVERAGE({{numfield}})](https://help.formsfly.com/en/article/average-repeat) |
| Median Repeat Value | [MEDIAN({{numfield}})](https://help.formsfly.com/en/article/median-repeat) |
| Maximum from a list of repeated values | [MAX({{numfield}})](https://help.formsfly.com/en/article/max-repeat) |
| Minimum from a list of repeated values | [MIN({{numfield}})](https://help.formsfly.com/en/article/min-repeat) |
| First Repeat Value | [FIRST({{repeatfield}})](https://help.formsfly.com/en/article/first-repeat) |
| Last Repeat Value | [LAST({{repeatfield}})](https://help.formsfly.com/en/article/last-repeat) |
| Join repeat answers with a separator | [JOIN(separatorString, repeatvalue)](https://help.formsfly.com/en/article/join-repeat) |

### ***10\. Lists/Sets of Values***

| **Purpose** | **Function** |
| --- | --- |
| List of Values | [LIST(pattern, 'optionalFilterFormula')](https://help.formsfly.com/en/article/list) |
| Convert To List | [TOLIST(value, 'optionaldelimiter', 'optionalFilterFormula')](https://help.formsfly.com/en/article/tolist) |
| Convert To List (Multi-field) | [TOLIST({{myfield1}}, {{myfield2}}, ..., {{myfieldN}}, 'optionalFilterFormula')](https://help.formsfly.com/en/article/tolist-multi-field) |
| In List of Values | [IN(value, list)](https://help.formsfly.com/en/article/in) |
| NOT In List of Values | [NOTIN(value, list)](https://help.formsfly.com/en/article/notin) |
| Count List Values | [COUNT(list)](https://help.formsfly.com/en/article/count) |
| Sum List Values | [SUM(list)](https://help.formsfly.com/en/article/sum) |
| Average List Value | [AVERAGE(list)](https://help.formsfly.com/en/article/average) |
| Median List Value | [MEDIAN(list)](https://help.formsfly.com/en/article/median) |
| Minimum List Value | [MIN(list)](https://help.formsfly.com/en/article/min) |
| Maximum List Value | [MAX(list)](https://help.formsfly.com/en/article/max) |
| First List Value | [FIRST(list)](https://help.formsfly.com/en/article/first) |
| Last List Value | [LAST(list)](https://help.formsfly.com/en/article/last) |

### ***11\. Data Sources***

| **Purpose** | **Function** |
| --- | --- |
| Count Rows | [DSCOUNT(dsId, 'optionalFilterFormula')](https://help.formsfly.com/en/article/dscount) |
| Sum Values in Column | [DSSUM(dsId, columnIndex, 'optionalFilterFormula')](https://help.formsfly.com/en/article/dssum) |
| Average Value in Column | [DSAVG(dsId, columnIndex, 'optionalFilterFormula')](https://help.formsfly.com/en/article/dsavg) |
| Maximum Value in Column | [DSMAX(dsId, columnIndex, 'optionalFilterFormula')](https://help.formsfly.com/en/article/dsmax) |
| Minimum Value in Column | [DSMIN(dsId, columnIndex, 'optionalFilterFormula')](https://help.formsfly.com/en/article/dsmin) |
| First Value in Column | [DSFIRST(dsId, columnIndex, 'optionalFilterFormula')](https://help.formsfly.com/en/article/dsfirst) |
| Last Value in Column | [DSLAST(dsId, columnIndex, 'optionalFilterFormula')](https://help.formsfly.com/en/article/dslast) |

### ***12\. Location***

| **Purpose** | **Function** |
| --- | --- |
| Latitude | [LAT(locationval)](https://help.formsfly.com/en/article/lat) |
| Longitude | [LON(locationval)](https://help.formsfly.com/en/article/lon) |
| Heading | [HEADING(locationval)](https://help.formsfly.com/en/article/heading) |
| Altitude | [ALTITUDE(locationval)](https://help.formsfly.com/en/article/altitude) |
| Accuracy | [ACCURACY(locationval)](https://help.formsfly.com/en/article/accuracy) |
| Street Number | [STREETNUM(locationval)](https://help.formsfly.com/en/article/streetnum) |
| Street Name | [STREET(locationval)](https://help.formsfly.com/en/article/street) |
| City / Locality | [CITY(locationval)](https://help.formsfly.com/en/article/city) |
| County / District | [COUNTY(locationval)](https://help.formsfly.com/en/article/county) |
| Postal / Zip Code | [POSTCODE(locationval)](https://help.formsfly.com/en/article/postcode) |
| Country Code | [COUNTRY(locationval)](https://help.formsfly.com/en/article/country) |
| Miles Between | [MIBETWEEN(startPoint, endPoint)](https://help.formsfly.com/en/article/mibetween) |
| Kilometres Between | [KMBETWEEN(startPoint, endPoint)](https://help.formsfly.com/en/article/kmbetween) |
| Is In Polygon (geofence) | [INPOLYGON(point, polygonPoints)](https://help.formsfly.com/en/article/inpolygon) |

### ***13\. Data Interchange***

| **Purpose** | **Function** |
| --- | --- |
| HTTP status code | [HTTPSTATUS({{restField}})](https://help.formsfly.com/en/article/httpstatus) |
| Value From JSON | [JSONVAL({{myjson}}, 'resp.token')](https://help.formsfly.com/en/article/jsonval) |
| List of Values From JSON | [JSONLIST({{myjson}}, 'resp.products.id')](https://help.formsfly.com/en/article/jsonlist) |
| Value From XML | [XMLVAL({{myxmlfield}}, 'resp/token')](https://help.formsfly.com/en/article/xmlval) |
| List of Values From XML | [XMLLIST({{myxml}}, 'resp/products/id')](https://help.formsfly.com/en/article/xmllist) |

### ***14\. Process Steps***

| **Purpose** | **Function** |
| --- | --- |
| Current Step Name | [STEP-CURRENT()](https://help.formsfly.com/en/article/step-current) |
| Is Current Step | STEP-ISCURRENT('dataname') |
| Last Completed Step | STEP-COMPLETED() |
|  | STEP-RESULT('dataname') |
| Step User Email | STEP-EMAIL('dataname') |
| Step User First Name | STEP-FIRST('dataname') |
| Step User Last Name | STEP-LAST('dataname') |
