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
Denise Wilhite 6Denise Wilhite 6 

Help with picklist formula field

I need some help please with a formula field.   I am trying to write a formula that references another field on the same object that is a picklist field.    I want to have the value in this new field to be based on the picklist value from the other field.  The formula that I am trying to write consists of:
 
IF(ISPICKVAL(Loan_Documentation__c = "Attorney Prepared", Yes,Bypass CDP,
ISPICKVAL(Loan_Documentation__c = "Internal Loan Agreement and Attorney Closed",Yes, Bypass CDP,
ISPICKVAL(Loan_Documentation__c, = "Internal Loan Agreement and No Attorney Closed", No,
ISPICKVAL(Loan_Documentation__c, = "No Loan Agreement Needed", No
)
)
)
)
)
I get an error message with this that states "Error:  Syntax error.  Found 'Bypass'.    What am I doing wrong?
 
Thank you!
Prakhar Saxena 19Prakhar Saxena 19
Hi Denise,

ISPICKVAL has two arguments and IF has three arguments.
ISPICKVAL(picklist_field, text_literal)
IF(logical_test, value_if_true, value_if_false)
https://help.salesforce.com/articleView?id=customize_functions_i_z.htm&type=5 (https://help.salesforce.com/articleView?id=customize_functions_i_z.htm&type=5)

You can try something like this:
IF(ISPICKVAL(Loan_Documentation__c, "Attorney Prepared"), Yes, 
IF(ISPICKVAL(Loan_Documentation__c, "Internal Loan Agreement and Attorney Closed"), Yes, 
IF(ISPICKVAL(Loan_Documentation__c, "Internal Loan Agreement and No Attorney Closed"), No,
IF(ISPICKVAL(Loan_Documentation__c, "No Loan Agreement Needed"), No, 
null))))




 
Deepali KulshresthaDeepali Kulshrestha
Hi Denise,

It's just that you're not passing the values correctly with the IF condition. You need to pass the values and expressions like:
For single conditions:
-> IF( Expression1=Expression2 , Value if true , Value if false)
or
For multiple conditions:
-> IF(Expression1=Expression2 , Value if true , 
     IF(Expression1=Expressiom3 , Value if true, 
     IF(--------)))

So if we talk about your formula, we can do it this way:
IF(ISPICKVAL(Loan_Documentation__c, "Attorney Prepared"), Bypass CDP, 
IF(ISPICKVAL(Loan_Documentation__c, "Internal Loan Agreement and Attorney Closed"), Bypass CDP, 
IF(ISPICKVAL(Loan_Documentation__c, "Internal Loan Agreement and No Attorney Closed"), No, 
IF(ISPICKVAL(Loan_Documentation__c, "No Loan Agreement Needed"), No, null))))

I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.

Thanks and Regards,
Deepali Kulshrestha