Compares an input value against a list and returns a corresponding value or error message in Salesforce Spiff. This function is similar to the vlookup() function except the lookup tables are specified within the function rather than in a lookup table.
Required Editions
Available in: both Salesforce Classic (not available in all orgs) and Lightning
Experience
Available in: Enterprise, Unlimited, and Developer
Editions
Available for an additional cost in: Professional Edition with Web
Services API Enabled
A list of value pairs, where each pair includes a value to match against lookup_value and a return value for that match. Enclose the list in brackets with comma-separated values. To specify an error message, such as when the list doesn't include lookup_value, the last item in the list can be a string that you want to show to admins.
Example
The Corporate AE Plan has a 10% commission rate and the Enterprise AE Plan has a 12% commission rate. Look up the plan name and apply the appropriate commission rate. Show an error message if the plan name isn't included in the list.
=switch(plan.name, ["Corporate AE PLan", "10%", "Enterprise AE Plan", "12%", "We couldn't find a rate for that plan name."])
Did this article solve your issue?
Let us know so we can improve!
Loading
Salesforce Help | Article
Cookie Consent Manager
General Information
Required Cookies
Functional Cookies
Advertising Cookies
General Information
We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required Cookies
Always Active
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional Cookies
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising Cookies
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.