If you want to learn Salesforce Functions, start from here:
The well-known platform for customer relationship management (CRM) Salesforce is rapidly growing day by day and made its position in the business world. Due to this, Salesforce acknowledged the demand and released the powerful “Salesforce Functions”.
Our tutorials are designed to help you learn the various Salesforce Functions with proper syntax and real-world business-related examples. Moreover, our tutorial shows the practical implementation of using these Salesforce Functions in both Salesforce Lightning and Salesforce Classic components.
Our tutorial perfectly helps beginners to develop the Salesforce application with the use of the Salesforce Functions. This tutorial will take you through all the Salesforce Function Categories such as Date & Time, Logical, Math, Text, and Advanced.
You will also learn how these Salesforce functions help developers to compute and deploy various difficult tasks within a short time period, with less thinking power, and in short steps. And also allows the developers to automate the workflows, and do real-time data processing.
So whether you are a developer or an administrator, our Salesforce tutorials can help you get familiar with the powerful Salesforce Functions.
Here you will find a detailed tutorial on 50+ Salesforce Functions. Each Salesforce function is covered in detail with Examples and Videos.
Salesforce Functions – Math
Math functions in Salesforce are used for performing mathematical operations and manipulation of numerical data. It includes functions that are used for trigonometric calculations, absolute value, rounding, etc.
Salesforce Function | Description |
---|---|
Salesforce ABS Function | The Salesforce ABS function can be used when you want to get a positive numeric value of a number. It returns the absolute value of a number, a number without its sign. |
Salesforce ACOS Function | The Salesforce ACOS function is best suited for situations when you focus on the magnitude of the value rather than the direction. It returns the arc cosine of the number in radians if the given number is between -1 and 1. Otherwise NULL. |
Salesforce ASIN Function | The Salesforce ASIN function can be used when you want to find the angle whose sine is a given number. It returns the arc sine of the number in radians if the given number is between -1 and 1. Otherwise NULL. |
Salesforce ATAN Function | The Salesforce ATAN function can be used when you are dealing with trigonometric calculations. It returns the arc tangent of the number in radians. |
Salesforce ATAN2 Function | The Salesforce ATAN2 function is best suited for situations when you want to calculate finance, statistics, data analysis, etc. It returns the arc tangent of the quotient of y and x in radians. |
Salesforce CEILING Function | The Salesforce CEILING function can be used when you want to round the decimal number. It rounds that number to the nearest integer that is greater than or equal to the original number, away from zero if negative. |
Salesforce COS Function | The Salesforce COS function can be used in geolocation, distance, time, pricing, and forecasting calculations. It returns the cosine of the number, where the number is given in radians. |
Salesforce DISTANCE Function | The Salesforce DISTANCE function is best suited to the situation where you need to work with geolocation data. It returns the distance between two locations using the provided unit. |
Salesforce EXP Function | The Salesforce EXP function is used to return e raised to the power of a given number. If x is the argument, EXP(x) is equivalent to e^x, where “e” is the base of the natural logarithm. |
Salesforce FLOOR Function | The salesforce FLOOR function can be used when you want to truncate the decimal part of a number, returning the nearest integer that is less than or equal to the given number. It rounds a number down, towards zero to the nearest integer. |
Salesforce GEOLOCATION Function | The Salesforce GEOLOCATION function can be used to return a location based on the provided latitude and longitude. It is always used with other functions called DISTANCE, to perform location-based queries and calculations |
Salesforce LN Function | The Salesforce LN function can be used to return the natural logarithm of a number. The natural logarithm of a number is the logarithm to the base e, where e is Euler’s number. |
Salesforce LOG Function | The Salesforce LOG function can be used to return the base 10 logarithm of n. It is the exponent to which 10 must be raised to obtain n. |
Salesforce MAX Function | The Salesforce MAX function can be used when you want to get the greatest value from the set of values passed as arguments. |
Salesforce MCEILING Function | The Salesforce MCEILING function can be used when you want to round the decimal number. It rounds that number to the nearest integer that is greater than or equal to the original number, towards the zero if negative. |
Salesforce MFLOOR Function | The salesforce MFLOOR function can be used when you want to truncate the decimal part of a number, returning the nearest integer. It rounds a number down, towards zero if negative. |
Salesforce MIN Function | The Salesforce MIN function can be used when you want to get the least value from the set of values passed as arguments. |
Salesforce MOD Function | The Salesforce MOD function can be best suited in scenarios like payment scheduling, time-based tasks, and inventory management. The MOD function, short for modulus that can be used to return the remainder after a number is divided by a divisor. |
Salesforce PI Function | The Salesforce PI function can be used to return the value of PI. It returns the value approximately to 3.14159. |
Salesforce ROUND Function | The Salesforce ROUND function can be best suited to situations when precision needs to be adjusted. It rounds to the number of decimal places to the right of the decimal point if the number is positive. If the number is negative it rounds to the left of the decimal point. |
Salesforce SIN Function | The Salesforce SIN function can be used when you are dealing with trigonometric calculations. It returns the sine of the number, where the number is given in radians. |
Salesforce SQRT Function | Salesforce SQRT function is a mathematical function short for square root function. It returns the positive square root of a number. The square root of a negative number is not a real number, but a complex number, if you pass it results in an error. |
Salesforce TAN Function | The Salesforce TAN function can be used to return the tangent of the given angle when the angle is given in the radians. |
Salesforce TRUNC Function | The Salesforce TRUNC function can be used to cut off numerical values to a specified number of decimal places. It can used in use cases such as e-commerce, forecasting, tax calculations, etc. |
Salesforce Functions – Text
Text functions in Salesforce are used to manipulate and analyze text strings. It includes functions that are used to extract substrings, convert text to lowercase or uppercase, calculate the length of the string, etc.
Salesforce Function | Description |
---|---|
Salesforce ASCII Function | The Salesforce ASCII function can be used to return the first character’s code point from the given string as a number. In a computer, each character has some special code point for example ‘A’ has a code point number of 65. |
Salesforce BEGINS Function | The Salesforce BEGINS function can be used to compare the first character of the text. It checks if the text begins with specified characters, if it is it returns TRUE. Otherwise returns FALSE |
Salesforce BR Function | The Salesforce BR function can be used to insert an HTML break tag in string formulas. It returns each field value on a new line. |
Salesforce CASEFIELDID Function | The Salesforce CASEFIELDID function can be best suited in situations where you want to reduce issues related to case sensitivity. It is used to convert a 15-character case-sensitive Salesforce record ID into an 18-character case-insensitive ID. |
Salesforce CHR Function | The Salesforce CHR function can used in the use cases where you want to get the character from the code point number. For example, 960 gives you the Ï€. It returns a string with the first character’s code point as the given number. |
Salesforce CONTAINS Function | The Salesforce CONTAINS function can be used to compare whether the text contains the substring or not. It checks if the text contains specified characters it returns TRUE. Otherwise, returns FALSE. The position of the text presented does not matter. |
Salesforce FIND Function | The Salesforce FIND function can be used to find the position of the substring within the main text. If the substring is presented it returns the first position of the substring and if not found, it returns 0. |
Salesforce GETSESSIONID Function | The Salesforce GETSESSIONID function can be used in the cases of hyperlinks to other applications that use salesforce.com credentials for authentication. It returns the current session ID. |
Salesforce HYPERLINK Function | The Salesforce HYPERLINK function can be best suited in situations where you want to generate a clickable link. It creates a hyperlink. |
Salesforce IMAGE Function | The Salesforce IMAGE function can create images based on certain conditions or field values. |
Salesforce INCLUDES Function | The Salesforce INCLUDES function can be used if you want to determine if any of the selected values in a multi-select picklist field match a specific text literal. If any of the selected values in the multi-select picklist field match, it returns TRUE, otherwise, it returns FALSE. |
Salesforce INITCAP Function | The Salesforce INITCAP function can be best suited when you want to make your input consistent, uniform, and in the proper format. It returns the text as lowercase with the first character of each word made uppercase. |
Salesforce ISPICKVAL Function | The Salesforce ISPICKVAL function can be used if you want to determine if any of the selected values in the picklist field match a specific text literal. If any of the selected values in the picklist field match, it returns TRUE, otherwise, it returns FALSE. |
Salesforce LEFT Function | The Salesforce LEFT function can be best suited in the scenario where you want to extract a specific portion of text data. It returns the specified number of characters from the start of a text string. |
Salesforce LEN Function | The Salesforce LEN function can be best suited in the scenario where you want to assess or manipulate text lengths. It returns the number of characters in a text string. |
Salesforce LOWER Function | The Salesforce LOWER function can be best suited in the scenario where you want to ensure that text is consistently represented in lowercase. It can be used to convert all letters in the value to lowercase. |
Salesforce LPAD Function | The Salesforce LPAD function can be best suited in the cases where you want to make the length of the string specific. It can be used to pad the left side of the value with spaces or the optional pad string so that the length is padded length. |
Salesforce MID Function | The Salesforce MID function can be used when you want to extract the character from the middle of a text string, from the given starting position to the specific length. |
Salesforce PICKLISTCOUNT Function | The Salesforce PICKLISTCOUNT function can be best suited in the situation where you need to find out how many values are selected in the multi-selected picklist field. It returns the number of selected values in a multi-select picklist. |
Salesforce REVERSE Function | The Salesforce REVERSE function can be used in scenarios like text manipulation, encryption, data transformation, etc. It returns the text string in reverse order. |
Salesforce RIGHT Function | The Salesforce RIGHT function can be best suited in the scenario where you want to extract a specific portion of text data. It returns the specified number of characters from the end of a text string. |
Salesforce RPAD Function | The Salesforce RPAD function can be best suited in the cases where you want to make the length of the string specific. It can be used to pad the right side of the value with spaces or the optional pad string so that the length is padded length. |
Salesforce SUBSTITUTE Function | The Salesforce SUBSTITUTE function can be best used when you want to replace specific text in a text string. It substitutes new text for old text in a text string. |
Salesforce TEXT Function | The Salesforce TEXT function can be suited to situations where you are sure that the result is treated as text. It converts a value to text using a standard display format |
Salesforce TRIM Function | The Salesforce TRIM function can be best suited to situations where you want to make uniformity in the text. It removes all spaces from a text string except for single spaces between words. |
Salesforce UPPER Function | The Salesforce UPPER function can be best suited in the scenario where you want to ensure that text is consistently represented in uppercase. It can be used to convert all letters in the value to uppercase. |
Salesforce VALUE Function | The Salesforce VALUE function can be used where you need to perform mathematical operations on a field that is stored as text. It converts a text string that represents a number to a number. |
Salesforce Functions – Date and Time
Date and Time functions in Salesforce are used to manage and manipulate date and time data. It includes functions that are used to calculate the difference between dates, extract components such as (day, month, year), formatting date and time value, etc.
Salesforce Function | Description |
---|---|
Salesforce ADDMONTHS Function | The Salesforce ADDMONTHS function can be used to add the number of months to the date, using the last date of the month if the date is the last day of the month or adding the number of months has fewer days. |
Salesforce DATE Function | The Salesforce DATE function can be best suited in cases where you want to deal with dates only. It creates a date from a year, month, and day. |
Salesforce DATETIMEVALUE Function | The Salesforce DATETIMEVALUE function can be best used in a situation where you want to convert a text string into a datetime. It returns a year, month, day, and GMT time value. |
Salesforce DATEVALUE Function | The Salesforce DATEVALUE function can be used in situations where you need the date value from the expression. It creates a date from its datetime or text representation. |
Salesforce DAY Function | The Salesforce DAY function can be best suited in situations where you need to extract the day part of the date or datetime field. It returns the day of the month, a number between 1 and 31. |
Salesforce DAYOFYEAR Function | The Salesforce DAYOFYEAR function can be used where you want the day of the year from the given date. It returns the day of the calendar year from 1 to 366. |
Salesforce FORMATDURATION Function | The Salesforce FORMATDURATION function can be best suited in situations where you want to format the duration of the date. It is used to format the number of seconds with optional days if set to True, otherwise, only the time part is included. Or the difference between times or dateTimes as HH:MI:SS. |
Salesforce FROMUNIXTIME Function | The Salesforce FROMUNIXTIME function can be best suited in the situation where you want to convert a Unix timestamp into a human-readable date and time format. It returns the datetime that represents the given number as the seconds elapsed since 1 Jan 1970. |
Salesforce HOUR Function | The Salesforce HOUR function can be best suited in situations where you need to extract the hour part of the time or datetime field. It returns the hour of the day. |
Salesforce ISOWEEK Function | The Salesforce ISOWEEK function can be used to obtain the ISO 8601 week number for a given date. ISO 8601 is an international standard for representing dates and times. It returns the ISO 8601 week number for the given date from 1 to 53 so that the first week starts on Monday. |
Salesforce ISOYEAR Function | The Salesforce ISOYEAR function can be used to return the ISO 8601 week-numbering 4-digit year for the given date so that the first day is a Monday. |
Salesforce MILLISECOND Function | The Salesforce MILLISECOND function can be best suited when you want to extract the millisecond part from a given time expression. It returns an integer value representing the millisecond portion of the time expression. |
Salesforce MINUTE Function | The Salesforce MINUTE function can be best suited in situations where you need to extract the minute part of the time or datetime field. It returns the minute of the day. |
Salesforce MONTH Function | The Salesforce MONTH function can be best suited in situations where you need to extract the month part of the date or datetime field. It returns the month, a number between 1 (January) and 12 (December) |
Salesforce NOW Function | The Salesforce NOW function can be best suited in the situation when you want to get the current date and time at the moment when the code is executed. |
Salesforce SECOND Function | The Salesforce SECOND function can be best suited in situations where you need to extract the second part of the time or datetime field. It returns the second of the day. |
Salesforce TIMENOW Function | The Salesforce TIMENOW function can be best suited in the situation when you want to get the current time at the moment when the code is executed. |
Salesforce TIMEVALUE Function | The Salesforce TIMEVALUE function can be best suited in the situation where you want to extract the time portion from a date-time value or from a text representation of a time. It returns a time. |
Salesforce TODAY Function | The Salesforce TODAY function can be used when you want to fetch the current date. |
Salesforce UNIXTIMESTAMP Function | The Salesforce UNIXTIMESTAMP function can be best suitable in situations where you want to convert a date or date-time value into a Unix timestamp. The Unix timestamp is a way to represent a point in time as the number of seconds. It returns the number of seconds since 1 Jan 1970 for the given date, or the number of seconds in the day for a time. |
Salesforce WEEKDAY Function | The Salesforce WEEKDAY function can be used in scenarios like scheduling, analyzing sales day, shift planning, campaigns, etc. It returns the day of the week for the given date, using 1 for Sunday, 2 for Monday, through 7 for Saturday. |
Salesforce YEAR Function | The Salesforce YEAR function can be used when you want to extract the year from a date or datetime field. It returns the year of a date as a number between 1900 and 9999. |
Salesforce Functions – Logical
Logical functions in Salesforce are used to evaluate conditions, make decisions, and return true or false based on the specified criteria. It includes functions that are used for IF statements, AND/OR conditions, handling null and blank values, etc.
Salesforce Function | Description |
---|---|
Salesforce AND Function | The Salesforce AND function can be best suited in situations where you want to make sure that multiple conditions are met simultaneously or in conjunction with expression. It checks whether all arguments are true and returns TRUE if all arguments are true. |
Salesforce BLANKVALUE Function | The Salesforce BLANKVALUE function can be best suited in situations where you want to substitute space with another value. It checks whether the expression is blank and returns a substitute expression if it is blank. If the expression is not blank, returns the original expression value. |
Salesforce CASE Function | The Salesforce CASE function can be used when you want to check 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 |
Salesforce IF Function | The Salesforce IF function is best suited for situations where you want to perform conditional evaluations. It checks whether a condition is true and returns one value if the condition is true, and another value if the condition is false. |
Salesforce ISBLANK Function | The Salesforce ISBLANK function is best suited for situations where you want to check whether a specified expression is blank. It returns TRUE if the expression is blank and FLASE if there is data in the field or expression. |
Salesforce ISNULL Function | The Salesforce ISNULL function is best suited for situations where you want to check if the expression evaluates to a null value. It returns true if the expression is null. Otherwise, it returns false. |
Salesforce ISNUMBER Function | The Salesforce ISNUMBER function can be used to check if the text value is a number if yes it returns TRUE. Otherwise, it returns FALSE. |
Salesforce NOT Function | The Salesforce NOT function can be used to change FALSE to TRUE or TRUE to FALSE. |
Salesforce NULLVALUE Function | The Salesforce NULLVALUE function can be used to check whether the expression is null and returns a substitute expression if it is null. If the expression is not null, returns the original expression value. |
Salesforce OR Function | The Salesforce OR function can be best suited in situations where you want to make sure at least one of the conditions is met. It checks multiple conditions and returns TRUE if any of the given conditions is true. Returns FALSE only if all arguments are false. |
Salesforce Function – Advanced
Advanced Salesforce function can be used in cases where the manipulation is not based on basic maths, text, logical, date, and time functions. It includes only the one function that is used for currency conversion in Salesforce.
Salesforce Function | Description |
---|---|
Salesforce CURRENCYRATE Function | The Salesforce CURRENCYRATE function can be best suited in the situation where you want to convert the currency to another currency rate. It returns the conversion rate to the corporate currency for the given CurrencyIsoCode, or 1.0 if the currency is invalid. |
For detailed information on each Salesforce function and how they can be written and used in your business, click on the Salesforce Function Name.
Conclusion
I hope now you have an idea of Salesforce functions. Next, you can check about Salesforce Formulas and Error and Fixes.