function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Rung41Rung41 

VF Email Template IF statement to conditionally show field value

I've hit a road block trying to conditionally show a value based on a picklist field and looking for some assistance as to what I am doing wrong.

I am trying to show the field value of "Other_Shipping_Address__c" if the picklist value of 'Other' is selected from the field Hardcover_Book_Ship_to_location__c. 

I've tried the following IF statement but keep getting the error of  Error: Incorrect parameter type for function 'ISPICKVAL()'. Expected Picklist, received Text

{!IF(ISPICKVAL("{!relatedTo.Hardcover_Book_Ship_to_location__c}", 'Other'),"{!relatedTo.Other_Shipping_Address__c}", NULL)} 

 

Best Answer chosen by Rung41
Waqar Hussain SFWaqar Hussain SF
{!IF(ISPICKVAL(relatedTo.Hardcover_Book_Ship_to_location__c, 'Other'), relatedTo.Other_Shipping_Address__c, NULL)}

try above code snippet.

All Answers

Waqar Hussain SFWaqar Hussain SF
{!IF(ISPICKVAL(relatedTo.Hardcover_Book_Ship_to_location__c, 'Other'), relatedTo.Other_Shipping_Address__c, NULL)}

try above code snippet.
This was selected as the best answer
Rung41Rung41
Thank you. However, I still receive the same error. ☹ Robert Rung Business Analyst [Brook Furniture Rental Logo] Brook Furniture Rental 100 N. Field Drive, Suite 220 | Lake Forest, IL 60045 P: 847.810.4038 | E: rrung@bfr.com [FACEBOOK |] [LINKED-IN |] [INSTAGRAM |] [TWITTER |] [Brook Blog]
Rung41Rung41
Your code was correct. However, I had to create and reference a formula field that basically copied the value of the picklist.