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
RichardR1RichardR1 

formula in process builder - Richard

Hi everyone, I have an issue I can't seem to solve on my own. In our Org we have automated rating (of quality) of Contacts and I used Process Builder for that since I have no coding experience.

Contact Abc's correct rating should be 2. For some reason, formula A does not rate Abc as 2, but formula B does.

Formula A:
AND(
        OR(
             [Contact].Account.Is_a_Venture_Capital_Firm__c  = TRUE ,
             [Contact].Account.Is_a_Private_Equity_Firm__c = TRUE ,
             AND(
                     OR(
                          ISPICKVAL( [Contact].Title_Achieved__c , 'Manager') ,
                          ISPICKVAL( [Contact].Title_Achieved__c , 'Associate') ,
                          ISPICKVAL( [Contact].Title_Achieved__c , 'Partner')
                          ) ,
               CONTAINS(UPPER([Contact].Account_Industry_c) , 'Technology')
               )
           ) ,
         NOT( CONTAINS( UPPER([Contact].Current_Title__c) , 'STUDENT' )) ,
         NOT( CONTAINS( UPPER([Contact].Current_Title__c) , 'ENGINEER' ))
        )

Formula B
AND(
        OR(
             [Contact].Account.Is_a_Venture_Capital_Firm__c  = TRUE ,
             [Contact].Account.Is_a_Private_Equity_Firm__c = TRUE ,
             ISPICKVAL( [Contact].Title_Achieved__c , 'Manager') ,
             ISPICKVAL( [Contact].Title_Achieved__c , 'Associate') ,
             ISPICKVAL( [Contact].Title_Achieved__c , 'Partner')
              ) ,
       NOT( CONTAINS( UPPER([Contact].Current_Title__c) , 'STUDENT' )) ,
       NOT( CONTAINS( UPPER([Contact].Current_Title__c) , 'ENGINEER' ))
       )

Is there anyting wrong with my Formula A?
Best Answer chosen by RichardR1
Andrew GAndrew G
Hi

If we quickly look at the logic - Formula B - only 1 of the first 5 criteria needs to be true:
OR(
             [Contact].Account.Is_a_Venture_Capital_Firm__c  = TRUE ,
             [Contact].Account.Is_a_Private_Equity_Firm__c = TRUE ,
             ISPICKVAL( [Contact].Title_Achieved__c , 'Manager') ,
             ISPICKVAL( [Contact].Title_Achieved__c , 'Associate') ,
             ISPICKVAL( [Contact].Title_Achieved__c , 'Partner')
              ) ,
Formula A - one of the first 2 needs to be true and one of the next three needs to be true:, so 2 of the first 5 criteria need to be met.
OR(
             [Contact].Account.Is_a_Venture_Capital_Firm__c  = TRUE ,
             [Contact].Account.Is_a_Private_Equity_Firm__c = TRUE ,
             AND(
                     OR(
                          ISPICKVAL( [Contact].Title_Achieved__c , 'Manager') ,
                          ISPICKVAL( [Contact].Title_Achieved__c , 'Associate') ,
                          ISPICKVAL( [Contact].Title_Achieved__c , 'Partner')
                          ) ,

also formula A has an extra criteria. So therefore, Formula A has 3 criteria to be met for the formula to evaluate true.
CONTAINS(UPPER([Contact].Account_Industry_c) , 'Technology')

Note also that the last criteria is doing an UPPER but the test String is in proper case "Technology".  Perhaps change that to TECHNOLOGY

Regards
Andrew