1

When trying to save the below formula I get this error:

The formula expression is invalid: Syntax error. Missing ')' Help Please

Why do I get this error? How can I fix it?

AND(
          IF ( ISBLANK( [Case].ContactId) , false,
          AND( ![Case].Contact.CSATOptOut__c,
                   OR( ISNULL(Contact.CSAT_Date__c ), true,
                   Contact.CSAT_Date__c  <= TODAY() -5 ),              
                   OR(
                       RecordTypeId = 0128E0000009Fd5QAE,
                       ISPICKVAL( Origin, "Telefon", "Chat" )
                   ),
                   ISBLANK( Contact.MemberInGroup__c, false ),
                   ISPICKVAL( Status, "Avslutat" ),
                   OwnerId <= "NatterBox",
                   OwnerId <= "API-User Api-User",
                   NOT( ISPICKVAL( CaseReason, "Inget svar" )),
                   Contact.CreatedDate <= NOW()       
          )
        )
        )
  • Wait, is this a formula in Process Builder or a Forumula Field? – Adrian Larson Apr 3 at 13:28
0

You are missing the quotes around your record type id and your external AND operator needs at least another value. Anyway there are many others syntax error.

ISNULL and ISBLANK functions return a boolean, then it's not correct to write:

ISNULL(Contact.CSAT_Date__c ), true

but only

ISNULL(Contact.CSAT_Date__c )

Other errors is that you are passing more then one value to ISPICKVAL function and that you're comparing a string (OwnerId) with the <= operator.

Try the above formula and edit per your needs:

IF(
        ISBLANK(ContactId),
        AND(
            CSATOptOut__c,
            OR(
                ISNULL(Contact.CSAT_Date__c),
                Contact.CSAT_Date__c  <= (TODAY()-5)
            ),
            OR(
                RecordTypeId = 0128E0000009Fd5QAE,
                ISPICKVAL( Origin, "Telefon"),
                ISPICKVAL( Origin, "Chat")
            ),
            ISBLANK( Contact.MemberInGroup__c ),
            ISPICKVAL( Status, "Avslutat" ),
            NOT( ISPICKVAL( CaseReason, "Inget svar" )),
            Contact.CreatedDate <= NOW()  
        )
    )

I would also suggest to check the logic of your formula and to use the Record Type Developer Name instead of the Id.

0

There are quite a few errors in your formula

  • You are not passing the second parameter for the AND operator. AND operator needs at least 2 values. (Top most AND)
  • You are using ISPICKVAL with 3 parameters whereas it takes only two
  • You are comparing OwnerId field with <= operator, I think it should be either == or !=
  • OwnerId is the Id field, so it will contain the Id and not Name, rather you will have to compare with Owner.Name
  • You are missing the quotes on RecordTypeId

The error you are getting is because of the first point i.e. if you don't have anything else to pass to AND operator, remove that operator or else pass the other value.

On solving this issue, you will get the remaining errors which I mentioned above which will help you fix this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.