List of All Available Formulas For Salesforce Flow

List of All Available Formulas For Salesforce Flow

Last Updated on May 21, 2023 by Rakesh Gupta

Big Idea or Enduring Question:

  • How to find out all formula functions allowed in a Flow?

Objectives:

After reading this blog, you’ll be able to:

  • Find out all formula functions supported in Salesforce Flow
  • Run SOQL for Tooling API objects
  • and much more

Business Use case

Isabella Stewart is working as a Salesforce Administrator at Gurukul On Cloud (GoC). She wants to learn how to find out all available formulas for Salesforce Flow.

Guided Practice (We-do):

With the Formula, you can create anything from simple mathematical equations to more complex and advanced calculations. In this article, you will learn how to find all of the available formula functions that can be used in Salesforce Flow! 

If you are looking for an explanation on how to use the formula, check out this article.

Let’s take a pause here, familiarize yourself with the FormulaFunction and FormulaFunctionAllowedType Tooling API objects. It contains

Object Name
Details
FormulaFunction It represents a function used when building a formula, including examples and uses. This object is available in Tooling API version 39.0 and later.
CustomFielFormulaFunctionAllowedTyped It represents the functions that are supported in the given formula context. This object is available in API version 48.0 and later.

Perform the steps below to get reliable code coverage:

  1. Click Setup | Developer Console.
  2. In the Query Editor, enter the following SOQL query 
    1. SELECT Function.Name, Function.Label, Function.Description, Function.ExampleString FROM FormulaFunctionAllowedType where Type=’Flow’
    2. Select the Use Tooling API checkbox.
    3. Click Execute.

SELECT Function.Name, Function.Label, Function.Description, Function.ExampleString
FROM FormulaFunctionAllowedType where Type='Flow'

List of all available formulas for Salesforce Flow

Name Label Description ExampleString
1 ABS ABS Returns the absolute value of a number, a number without its sign ABS(number)
2 ACOS ACOS Returns the arc cosine of the number in radians, if the given number is between -1 and 1. Otherwise NULL. ACOS(number)
3 ADDMONTHS ADDMONTHS Add the num months to the date, using the last date of the month if date is the last day of the month or adding num months has fewer days. ADDMONTHS(date,num)
4 AND AND Checks whether all arguments are true and returns TRUE if all arguments are true AND(logical1,logical2,…)
5 ASCII ASCII Return the first character’s code point from the given string as a number. ASCII(text)
6 ASIN ASIN Returns the arc sine of the number in radians, if the given number is between -1 and 1. Otherwise NULL. ASIN(number)
7 ATAN ATAN Returns the arc tangent of the number in radians. ATAN(number)
8 ATAN2 ATAN2 Returns the arc tangent of the quotient of y and x in radians. ATAN2(y, x)
9 BEGINS BEGINS Checks if text begins with specified characters and returns TRUE if it does. Otherwise returns FALSE BEGINS(text, compare_text)
10 BLANKVALUE BLANKVALUE Checks whether expression is blank and returns substitute_expression if it is blank. If expression is not blank, returns the original expression value. BLANKVALUE(expression, substitute_expression)
11 BR BR Inserts an HTML break tag in string formulas BR()
12 CASE CASE Checks an expression against a series of values.  If the expression compares equal to any value, the corresponding result is returned. If it is not equal to any of the values, the else-result is returned CASE(expression, value1, result1, value2, result2,…,else_result)
13 CASESAFEID CASESAFEID Converts a 15-character ID into a case insensitive 18-character ID CASESAFEID(id)
14 CEILING CEILING Rounds a number up to the nearest integer, away from zero if negative CEILING(number)
15 CHR CHR Return a string with the first character’s code point as the given number. CHR(number)
16 CONTAINS CONTAINS Checks if text contains specified characters, and returns TRUE if it does. Otherwise, returns FALSE CONTAINS(text, compare_text)
17 COS COS Returns the cosine of the number, where the number given in radians COS(number)
18 CURRENCYRATE CURRENCYRATE Return the conversion rate to the corporate currency for the given CurrencyIsoCode, or 1.0 if the currency is invalid. CURRENCYRATE(IsoCode)
19 DATE DATE Creates a date from a year, month and day DATE(year,month,day)
20 DATETIMEVALUE DATETIMEVALUE Returns a year, month, day and GMT time value DATETIMEVALUE(expression)
21 DATEVALUE DATEVALUE Creates a date from its datetime or text representation DATEVALUE(expression)
22 DAY DAY Returns the day of the month, a number between 1 and 31 DAY(date)
23 DAYOFYEAR DAYOFYEAR Return the day of the calendar year (from 1-366). DAYOFYEAR(date)
24 DISTANCE DISTANCE Returns the distance between two locations using the provided unit. DISTANCE(location, location, unit)
25 EXP EXP Returns e raised to the power of a given number EXP(number)
26 FIND FIND Returns the position of the search_text string in text FIND(search_text, text [, start_num])
27 FLOOR FLOOR Rounds a number down, towards zero to the nearest integer FLOOR(number)
28 FORMATDURATION FORMATDURATION Format the number of seconds with optional days, or the difference between times or dateTimes as HH:MI:SS. FORMATDURATION(numSeconds[, includeDays] | dateTime/time, dateTime/time)
29 FROMUNIXTIME FROMUNIXTIME Return the datetime that represents the given number as the seconds elapsed since 1 Jan 1970. FROMUNIXTIME(number)
30 GEOLOCATION GEOLOCATION Returns a location based on the provided latitude and longitude. GEOLOCATION(latitude, longitude)
31 GETSESSIONID GETSESSIONID Returns the current session ID. This may be useful in hyperlinks to other applications that use salesforce.com credentials for authentication GETSESSIONID()
32 HTMLENCODE HTMLENCODE Encodes text and merge field values for use in HTML HTMLENCODE(text)
33 HYPERLINK HYPERLINK Creates a hyperlink HYPERLINK(url, friendly_name [, target])
34 IF IF Checks whether a condition is true, and returns one value if TRUE and another value if FALSE. IF(logical_test, value_if_true, value_if_false)
35 INCLUDES INCLUDES Determines if any value selected in a multi-select picklist field equals a text literal you specify. INCLUDES(multiselect_picklist_field, text_literal)
36 INITCAP INITCAP Return the text as lowercase with first character of each word made uppercase. INITCAP(text)
37 ISBLANK ISBLANK Checks whether an expression is blank and returns TRUE or FALSE ISBLANK(expression)
38 ISNULL ISNULL Checks whether an expression is null and returns TRUE or FALSE ISNULL(expression)
39 ISNUMBER ISNUMBER Returns TRUE if the text value is a number. Otherwise, it returns FALSE. ISNUMBER(Text)
40 ISOWEEK ISOWEEK Return the ISO 8601 week number for the given date (from 1-53) so that the first week starts on monday. ISOWEEK(date)
41 ISOYEAR ISOYEAR Return the ISO 8601 week-numbering 4-digit year for the given date so that the first day is a monday. ISOYEAR(date)
42 ISPICKVAL ISPICKVAL Checks whether the value of a picklist field is equal to a string literal ISPICKVAL(picklist_field, text_literal)
43 JSENCODE JSENCODE Encodes text and merge field values for use in JavaScript JSENCODE(text)
44 JSINHTMLENCODE JSINHTMLENCODE Encodes text and merge field values for use in JavaScript within HTML tags JSINHTMLENCODE(text)
45 LEFT LEFT Returns the specified number of characters from the start of a text string LEFT(text, num_chars)
46 LEN LEN Returns the number of characters in a text string LEN(text)
47 LINKTO LINKTO Returns the HTML link element for the selected target with optional inputs expressed as query parameters LINKTO(label, target, id, [inputs], [no override])
48 LN LN Returns the natural logarithm of a number LN(number)
49 LOG LOG Returns the base 10 logarithm of n LOG(number)
50 LOWER LOWER Converts all letters in the value to lowercase LOWER(text)
51 LPAD LPAD Pad the left side of the value with spaces or the optional pad string so that the length is padded_length LPAD(text, padded_length [, pad_string])
52 MAX MAX Returns the greatest of all the arguments MAX(number,number,…)
53 MCEILING MCEILING Rounds a number up to the nearest integer, towards zero if negative MCEILING(number)
54 MFLOOR MFLOOR Rounds a number down to the nearest integer, away from zero if negative MFLOOR(number)
55 MID MID Returns character from the middle of a text string, given a starting position and length MID(text, start_num, num_chars)
56 MIN MIN Returns the least of all the arguments MIN(number,number,…)
57 MOD MOD Returns the remainder after a number is divided by a divisor MOD(number,divisor)
58 MONTH MONTH Returns the month, a number between 1 (January) and 12 (December) MONTH(date)
59 NOT NOT Changes FALSE to TRUE or TRUE to FALSE NOT(logical)
60 NOW NOW Returns a datetime representing the current moment NOW()
61 NULLVALUE NULLVALUE Checks whether expression is null and returns substitute_expression if it is null. If expression is not null, returns the original expression value. NULLVALUE(expression, substitute_expression)
62 OR OR Checks whether any of the arguments are true and returns TRUE or FALSE. Returns FALSE only if all arguments are false OR(logical1,logical2,…)
63 PI PI Returns pi PI()
64 PICKLISTCOUNT PICKLISTCOUNT Returns the number of selected values in a multi-select picklist. PICKLISTCOUNT(multiselect_picklist_field)
65 PREDICT PREDICT Returns an Einstein Discovery prediction based on either a record ID or a list of fields and their values. PREDICT(PredDefId, [recordId] | [field, value, …])
66 REGEX REGEX Returns TRUE if Text matches the regular expression RegEx_Text. Otherwise, it returns FALSE. REGEX(Text, RegEx_Text)
67 REVERSE REVERSE Returns the text string in reverse order REVERSE(text)
68 RIGHT RIGHT Returns the specified number of characters from the end of a text string RIGHT(text, num_chars)
69 ROUND ROUND Rounds a number to a specified number of digits ROUND(number,num_digits)
70 RPAD RPAD Pad the right side of the value with spaces or the optional pad string so that the length is padded_length RPAD(text, padded_length [, pad_string])
71 SIN SIN Returns the sine of the number, where the number given in radians SIN(number)
72 SQRT SQRT Returns the positive square root of a number SQRT(number)
73 SUBSTITUTE SUBSTITUTE Substitutes new_text for old_text in a text string. Use SUBSTITUTE when you want to replace specific text in a text string SUBSTITUTE(text, old_text, new_text)
74 TAN TAN Returns the tangent of the number, where the number given in radians TAN(number)
75 TEXT TEXT Converts a value to text using standard display format TEXT(value)
76 TODAY TODAY Returns the current date TODAY()
77 TRIM TRIM Removes all spaces from a text string except for single spaces between words TRIM(text)
78 TRUNC TRUNC Truncates a number to a specified number of digits TRUNC(number,num_digits)
79 UNIXTIMESTAMP UNIXTIMESTAMP Return the number of seconds since 1 Jan 1970 for the given date, or number of seconds in the day for a time. UNIXTIMESTAMP(date/time)
80 UPPER UPPER Converts all letters in the value to uppercase UPPER(text)
81 URLENCODE URLENCODE Encodes text and merge field values for use in URLs URLENCODE(text)
82 URLFOR URLFOR Returns the url for the selected target with optional inputs expressed as query parameters URLFOR(target, id, [inputs], [no override])
83 VALUE VALUE Converts a text string that represents a number to a number VALUE(text)
84 WEEKDAY WEEKDAY Return the day of the week for the given date, using 1 for Sunday, 2 for Monday, through 7 for Saturday. WEEKDAY(date)
85 YEAR YEAR Returns the year of a date, a number between 1900 and 9999 YEAR(date)

Formative Assessment:

I want to hear from you!

What is one thing you learned from this post? How do you envision applying this new knowledge in the real world? Feel free to share in the comments below.

Have feedback, suggestions for posts, or need more information about Salesforce online training offered by me? Say hello, and leave a message!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.