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
Ankit Garg 117Ankit Garg 117 

CASE and IF formula

Hi,

I have 2 picklist name Practice Stage and BC Stage. I have created Text Formula Field name ''Funnel Stage''.

Values of "Practice Stage" is  - Cold, Demo Booked, Demo Completed, Interested, Not Interested. 
Values of "BC Stage" is Enabled, Disabled.

What I want is if Practice Stage is NOT equal to Cold, Demo Booked, Demo Completed, Interested, Not Interested ''Funnel Stage'' shows BC Stage value. and IF BC Stage is blank, ''Funnel Stage'' Shows ''Practice Stage'' value. 

Is this possible?
Andrew GAndrew G
Hi Ankit

You would need to play with both the CONTAINS and ISBLANK formula,
So something like:
IF( ISBLANK(BC_Stage__c), "Practice Stage",
  IF( NOT CONTAINS(TEXT(Practice_Stage__c),"Cold:Demo Booked:Demo Completed:Interested:Not Interested"),
    BC_Stage__c,
    ""
  )
)

Regards
Andrew
Ankit Garg 117Ankit Garg 117
Hey Andrew,

Its coming up with an arror  - 
 Error: Field BC_lead_stage__c is a picklist field. Picklist fields are only supported in certain functions

Practice Stage and BC Stage are picklist fields and BC Funnel is a formula field with return type as Text. 

Regards,
Ankit Garg 117Ankit Garg 117
Please note  - BC Stage API name is BC_lead_stage--c
Andrew GAndrew G
Being picklist, we can't call it directly.  Which is why we have formula like ISPICKVAL, but in this situation I would use TEXT
IF( ISBLANK(TEXT(BC_lead_Stage__c)), "Practice Stage",
  IF( NOT CONTAINS(TEXT(Practice_Stage__c),"Cold:Demo Booked:Demo Completed:Interested:Not Interested"),
    TEXT( BC_lead_Stage__c ),
    ""
  )
)
Regards
Andrew