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
EHEH 

I need some assist with this IF statement. I've tried the following IF statement but keep getting the error: ArgumentError: Incorrect parameter type for function 'ISPICKVAL()'. Expected Picklist, received Text

Can somebody assist me with formatting this correctly:

{!IF(ISPICKVAL(Event.Affiliate_Location__c, "New York"), "address 1", !IF(ISPICKVAL(Event.Affiliate_Location__c, "Denver"), "address 2", "address 3"))}

I keep getting: ArgumentError: Incorrect parameter type for function 'ISPICKVAL()'. Expected Picklist, received Text
Sai PraveenSai Praveen (Salesforce Developers) 
Hi,

Is Event.Affiliate_Location__c a picklist field? I dont see any issue with the syntax of IF() condition.

Thanks
 
EHEH
@sai Yes it's a picklist field. 
Sai PraveenSai Praveen (Salesforce Developers) 
Hi,

Can you try like below.
 
{!IF(Text(Event.Affiliate_Location__c)= "New York", "address 1", !IF(Text(Event.Affiliate_Location__c)= "Denver", "address 2", "address 3"))}

Let me know if you face any issues.

If this solution helps, Please mark it as best answer.

Thanks,
Abdul KhatriAbdul Khatri
Hi EH

I guess you are trying that in a formula field, can I know what is that { at the beginning } at the end? I don't think we need that. Also, what is that ! sign before each IF statement. I guess that is causing the issues. If with ! you mean NOT that I would suggest to write this entire thing like this but I don't understand this NOT part 
 
IF(NOT(ISPICKVAL(Event.Affiliate_Location__c, "New York")), "address 1", IF(NOT(ISPICKVAL(Event.Affiliate_Location__c, "Denver")), "address 2", "address 3"))

I hope this will help you get rid of that issue.

Regards,
EHEH
Thank you Sai and Abdul! I will test both methods and see which one provides me with the results i'm looking for.