1

I am trying check if the suppliedemail field contains any of these domains but is not working.

If(CONTAINS("lincare.com:ndc-inc.com:preferredhomecare.com", SuppliedEmail),
            mod(value(CaseNumber),3)+1,0)

1 Answer 1

1

This won't work as you designed it as SuppliedEmail will look like [email protected] and that will never be contained inside the first arg of the CONTAINS.

Your approach works great for a problem wherein the matchKey will exist somewhere inside the first argument. For example, this stateCode match from the doc:

IF(ISBLANK(BillingState), "None",
IF(CONTAINS("AK:AZ:CA:HA:NV:NM:OR:UT:WA", BillingState), "West",
IF(CONTAINS("CO:ID:MT:KS:OK:TX:WY", BillingState), "Central",
IF(CONTAINS("CT:ME:MA:NH:NY:PA:RI:VT", BillingState), "East",
IF(CONTAINS("AL:AR:DC:DE:FL:GA:KY:LA:MD:MS:NC:NJ:SC:TN:VA:WV", BillingState), "South",
IF(CONTAINS("IL:IN:IA:MI:MN:MO:NE:ND:OH:SD:WI", BillingState), "North", "Other"))))))

You have a couple of options:

Option 1: (from SteveMo answer)

Your matchkey needs to be just the domain portion of the email:

If(CONTAINS("lincare.com:ndc-inc.com:preferredhomecare.com", 
        SUBSTITUTE(SuppliedEmail, LEFT(SuppliedEmail, FIND("@", SuppliedEmail)), NULL),
        mod(value(CaseNumber),3)+1,0)

Option 2: Use REGEX

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .