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. Contextual7. Data Conversion
2. System Values8. Choices
3. Maths9. Repeats/ Tables
4. Text/String 10. Lists/Sets of Values
5. Date/Time11. Data Sources
6. Logic12. Location

1. Contextual

PurposeFunction
User's Email AddressUSEREMAIL()
User's First NameUSERFIRSTNAME()
User's Last NameUSERLASTNAME()
User's External IdUSEREXTERNALID()
Value Matches Current UserUSERINGROUP()
Organisation NameORGNAME()
Global ValueGLOBALVAL('keyname')
Organisation Meta ValueORGMETA('key')
User Meta ValueUSERMETA('key')
Device NameDEVICENAME()
Operating System NameDEVICEOS()
Operating System VersionDEVICEOSVERSION()
Current App VersionAPPVERSION()
Current Screen VersionSCREENVERSION()
Screen Last Updated (UTC)SCREENDATE()
Direct ValueVAL('dataname')
Screen ParameterCOUNTER()
Linked Task Data - APP ONLYTASK('key')
 USERLANG()

2. System Values

PurposeFunction
Current DateTODAY()
Current Date and TimeNOW()
Current UTC (GMT) DateUTCTODAY()
Current UTC (GMT) Date & TimeUTCNOW()
 TASK-FIRSTAVAILABLE()
 TASK-FIRSTTOCLAIM()

3. Maths

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

PurposeFunction
Add+
Subtract-
Multiply*
DivideDIV
ModuloMOD
RoundingROUND(value, decimals)
MaximumMAX(val1, val2)
MinimumMIN(val1, val2)
TruncateTRUNC(val)
PowerPOW(val, power)
FloorFLOOR(val)
CeilingCEILING(val)
AbsoluteABS(val)
Random NumberRANDOM(length)

4. Text/String

PurposeFunction
Join bits of text togetherCONCAT(value1, value2, ...)
Get part of a piece of text

SUBSTR(value, start)

SUBSTR(value, start, length)

Length of a piece of textSTRING-LENGTH(value)
Join values with a separatorJOIN(separatorString, value1, value2, ...)
Substitute new text for old textSUBSTITUTE(val, old_text, new_text)
Lower CaseLOWER(val)
Upper CaseUPPER(val)
Starts WithSTARTSWITH(val, startswith)
Contains TextCONTAINS(val, contains)
Index / Position of TextINDEXOF(input, value, optionalStartIndex, optionalCount)
Split StringSPLIT(input, delimiter, optionalIndex)
Random StringRANDOMSTR(length)
GUIDGUID()
New Line Character"\n"

5. Date/Time

PurposeFunction
Add To DateDATEADD(startdate, numberunits, unit)
Difference Between DatesDATEDIFF(startdate, enddate, unit)
Convert UTC Date to Local DateDATETOLOCAL 
(utcdateval)
Convert Local Date to UTC DateDATETOUTC 
(localdateval)
YearYEAR(dateval)
MonthMONTH(dateval)
DayDAY(dateval)
HourHOUR(dateval)
MinuteMINUTE(dateval)
SecondSECOND(dateval)
Day of WeekDAYWEEK(dateval)
Day of YearDAYYEAR(dateval)
Week of YearWEEKYEAR(dateval)
Creation Date / Time of ImageIMGDATE(imagefield)

6. Logic

PurposeFunction
NotNOT(val)
AndAND
OrOR
TrueTRUE()
FalseFALSE()
Equal to=
Greater than     
Greater than or equal
>     
>=
Less than     
Less than or equal
<     
<=
Conditional (if/else)IF(condition, trueval, falseval)
Is Blank or EmptyISBLANK(val)
Not Blank or EmptyNOTBLANK(val)
First non-empty valueCOALESCE(val1, val2)
Regularly used  expressionsREGEX(input, pattern)
Regular Expression ReplacementREPLACE(input, pattern, replacement)

7. Data Conversion

PurposeFunction
Convert to numberNUMBER(value)
Convert to stringSTRING(value)
Convert to dateDATE(value)
Convert Date to text in a particular formatFORMAT-DATE(value, format)
Format Number to TextFORMAT-NUM(val, format, optionalCulture)
Format Location to TextFORMAT-GEO(val, format)
To IntegerINT(val)
To BooleanBOOLEAN(val)
To CheckBox (Ticked or Crossed)CBOX(val, matchTo)
To CheckBox (Ticked or Blank)CBOXB(val, matchTo)
To File URLFILEURL(fieldname)

8. Choices

PurposeFunction
Check if an answer is selectedSELECTED(dataname, value)
Count selected itemsCOUNT-SELECTED(dataname)

9. Repeats/Tables

PurposeFunction
Repeat/Row PositionPOSITION({{repeat}})
Prior Repeat ValuesPRIOR('dataname', occurrences)
Count no of repeatsCOUNT({{repeat}})
Add repeated valuesSUM({{numfield}})
Average Repeat/RowsAVERAGE({{numfield}})
Median Repeat ValueMEDIAN({{numfield}})
Maximum from a list of repeated valuesMAX({{numfield}})
Minimum from a list of repeated valuesMIN({{numfield}})
First Repeat ValueFIRST({{repeatfield}})
Last Repeat ValueLAST({{repeatfield}})
Join repeat answers with a separatorJOIN(separatorString, repeatvalue)

10. Lists/Sets of Values

PurposeFunction
List of ValuesLIST(pattern, 'optionalFilterFormula')
Convert To ListTOLIST(value, 'optionaldelimiter', 'optionalFilterFormula')
Convert To List (Multi-field)TOLIST({{myfield1}}, {{myfield2}}, ..., {{myfieldN}}, 'optionalFilterFormula')
In List of ValuesIN(value, list)
NOT In List of ValuesNOTIN(value, list)
Count List ValuesCOUNT(list)
Sum List ValuesSUM(list)
Average List ValueAVERAGE(list)
 MEDIAN(list)
Minimum List ValueMIN(list)
Maximum List ValueMAX(list)
First List ValueFIRST(list)
Last List ValueLAST(list)

11. Data Sources

PurposeFunction
Count RowsDSCOUNT(dsId, 'optionalFilterFormula')
Sum Values in ColumnDSSUM(dsId, columnIndex, 'optionalFilterFormula')
Average Value in ColumnDSAVG(dsId, columnIndex, 'optionalFilterFormula')
Maximum Value in ColumnDSMAX(dsId, columnIndex, 'optionalFilterFormula')
Minimum Value in ColumnDSMIN(dsId, columnIndex, 'optionalFilterFormula')
First Value in ColumnDSFIRST(dsId, columnIndex, 'optionalFilterFormula')
Last Value in ColumnDSLAST(dsId, columnIndex, 'optionalFilterFormula')

12. Location

PurposeFunction
LatitudeLAT(locationval)
LongitudeLON(locationval)
HeadingHEADING(locationval)
AltitudeALTITUDE(locationval)
AccuracyACCURACY(locationval)
Street NumberSTREETNUM(locationval)
Street NameSTREET(locationval)
City / LocalityCITY(locationval)
County / DistrictCOUNTY(locationval)
Postal / Zip CodePOSTCODE(locationval)
Country CodeCOUNTRY(locationval)
Miles BetweenMIBETWEEN(startPoint, endPoint)
Kilometres BetweenKMBETWEEN(startPoint, endPoint)
Is In Polygon (geofence)INPOLYGON(point, polygonPoints)