1

I am working around salesforce's formula field in Process Builder, to compare two fields values. For instance, the field Contact_A__c and Contact_B__c are picklist field types. I am attempting to compare several values of the picklist fields. In particular, I am attempting to create a comparison formula field to update the value of a text field "Result of Comparison" as an immediate action when the following condition is fulfilled.

IF(OR(ISPICKVAL([Comparison__c].Contact_A__c.Tipo__c, "Gold Partner", 
   CONTAINS([Comparison__c].Contact_B__c.Tipo__c, "Silver Partner")), 
   "The Contact A represent an excelent Opportunity")

However, it is appearing the following

Error message: "The formula expression is invalid: Field Comparison is a picklist field. Picklist fields are only supported in certain functions"

After to review http://resources.docs.salesforce.com/208/20/en-us/sfdc/pdf/salesforce_useful_formula_fields.pdf I understood better how to compare two text fields. But, I have not been able to identify what is required to overcome the error message. So, could you please suggest me how could be solved the error message of the formula field of Process Builder?

Best regards,

2

CONTAINS does not work on picklist fields, only text fields. You should be able to convert the value as you like using TEXT:

IF(OR(
  ISPICKVAL([Comparison__c].Contact_A__c.Tipo__c, "Gold Partner"), 
  CONTAINS(TEXT([Comparison__c].Contact_B__c.Tipo__c), "Silver Partner")),
  "The Contact A represent an excelent Opportunity",null)
6
  • I add a parenthesis to close PICKVAL. But, there is a message error about: The formula expression is invalid: Incorrect number of parameters for function: 'IF()'. Expected 3, received 2 ____________________________ - IF(OR( ISPICKVAL([Comparison__c].Contact_A__c.Tipo__c, "Gold Partner"), CONTAINS(TEXT([Comparison__c].Contact_B__c.Tipo__c), "Silver Partner")), "The Contact A represent a best Opportunity") Dec 11 '18 at 19:22
  • @JeanFernandez Yeah, I didn't pay close enough attention. I edited in the missing parentheses, and added the needed third parameter. If statements do require both an if and else value.
    – sfdcfox
    Dec 11 '18 at 19:25
  • Thank you @sfdcfox. Do you know how can I show the result of the comparison in a text field? Dec 11 '18 at 19:29
  • @JeanFernandez you'd use an if statement. I'm not sure what you mean otherwise.
    – sfdcfox
    Dec 11 '18 at 19:39
  • I mean that I would like to show in a field, the result of the IF comparison. Or, I also would like to show the name of the contact A as a result of the comparison, a kind of call to the name of contact A. Dec 11 '18 at 20:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.