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
Rudi OrnelasRudi Ornelas 

Picklist driven address

Hi, Team,

I'm trying to get this formula field finalized, however, it keeps populating the shipping value no matter what the picklist selection is. So, it always default to shipping city. The logic should go if type = hospital populate ShippingCity, else, populate BillingCity
 
IF(
OR(
ISPICKVAL(Type, "Hospital"),
ISBLANK(TEXT(Type))
),
ShippingCity,
BillingCity
)

 
Best Answer chosen by Rudi Ornelas
Maharajan CMaharajan C
Hi Rudi,

You have metioned one more condtion in formula ISBLANK(TEXT(Type)) which is in OR condtion. So ShippingCity will be populated eiether the Type is "Hospital"  or  if you don't have any value in Type.

If you want only the Shipping city should be populated when Type is "Hospital" then remove the Type Blank check from your formula. So you will get the BillingCity when the type is not Hospital.
 
IF(
ISPICKVAL(Type, "Hospital"),
ShippingCity,
BillingCity
)

Thanks,
Maharajan.C

 

All Answers

Maharajan CMaharajan C
Hi Rudi,

You have metioned one more condtion in formula ISBLANK(TEXT(Type)) which is in OR condtion. So ShippingCity will be populated eiether the Type is "Hospital"  or  if you don't have any value in Type.

If you want only the Shipping city should be populated when Type is "Hospital" then remove the Type Blank check from your formula. So you will get the BillingCity when the type is not Hospital.
 
IF(
ISPICKVAL(Type, "Hospital"),
ShippingCity,
BillingCity
)

Thanks,
Maharajan.C

 
This was selected as the best answer
Rudi OrnelasRudi Ornelas
Good lookin' out Maharajan C. This is right on the money. I really appreciate you taking the time to answer :)