You need to sign in to do that
Don't have an account?
Sydney Pedigo
Can I use the last variable in the CASE function to put other CASE function? Like a nested CASE?
I made this formula and am not sure why I keep getting an error that I'm missing an end parentheses. I wasn't sure if it was because I was using the CASE function incorrectly or if what I want to do isn't possible with CASE. And I can't think of an apparent way to put this in an IF statement. Would love help!
(FYI, the Neighborhood__c is a lookup field, so I put in the ID for the record. The other way of putting a value in quotation marks didn't work either).
This is the formula:
CASE( Neighborhood__c,
a2o1M000000n2AXQAY, "South Dallas"
a2o1M000000n2ADQAY, "West Dallas",
CASE(Neighborhood__r.Parent_Neighborhood__c,
a2o1M000000n2AXQAY, "South Dallas"
a2o1M000000n2ADQAY, "West Dallas"
CASE(Neighborhood__r.Parent_Neighborhood__r.Parent_Neighborhood__c,
a2o1M000000n2AXQAY, "South Dallas"
a2o1M000000n2ADQAY, "West Dallas",
CASE(Neighborhood__r.Parent_Neighborhood__r.Parent_Neighborhood__r.Parent_Neighborhood__c,
a2o1M000000n2AXQAY, "South Dallas"
a2o1M000000n2ADQAY, "West Dallas", NULL)
)
)
)
(FYI, the Neighborhood__c is a lookup field, so I put in the ID for the record. The other way of putting a value in quotation marks didn't work either).
This is the formula:
CASE( Neighborhood__c,
a2o1M000000n2AXQAY, "South Dallas"
a2o1M000000n2ADQAY, "West Dallas",
CASE(Neighborhood__r.Parent_Neighborhood__c,
a2o1M000000n2AXQAY, "South Dallas"
a2o1M000000n2ADQAY, "West Dallas"
CASE(Neighborhood__r.Parent_Neighborhood__r.Parent_Neighborhood__c,
a2o1M000000n2AXQAY, "South Dallas"
a2o1M000000n2ADQAY, "West Dallas",
CASE(Neighborhood__r.Parent_Neighborhood__r.Parent_Neighborhood__r.Parent_Neighborhood__c,
a2o1M000000n2AXQAY, "South Dallas"
a2o1M000000n2ADQAY, "West Dallas", NULL)
)
)
)
The message with the missing end parentheses is often misleading because it is more often missing commas.
CASE( Neighborhood__c,
"a2o1M000000n2AXQAY", "South Dallas" ,
"a2o1M000000n2ADQAY", "West Dallas",
CASE(Neighborhood__r.Parent_Neighborhood__c,
"a2o1M000000n2AXQAY", "South Dallas" ,
"a2o1M000000n2ADQAY", "West Dallas" ,
CASE(Neighborhood__r.Parent_Neighborhood__r.Parent_Neighborhood__c,
"a2o1M000000n2AXQAY", "South Dallas" ,
"a2o1M000000n2ADQAY", "West Dallas",
CASE(Neighborhood__r.Parent_Neighborhood__r.Parent_Neighborhood__r.Parent_Neighborhood__c,
"a2o1M000000n2AXQAY", "South Dallas" ,
"a2o1M000000n2ADQAY", "West Dallas", NULL)
)
)
)
WARNING: don't copy/paste a formula but just add the missing commas manually at the end of each line.
But the formula still isn't working. It's a field on Activity to show a specific text (South Dallas or West Dallas" based off the value in a lookup field (the Neighborhood__r.Parent_Neighborhood__c and etc.). Am I not referencing the value in the lookup field correctly? I've tried (in quotation marks) the object ID and the URL link and don't know how else to reference this.
Sydney