0

WE are creating a workflow rule, field update formula. From a WFR. My users are requesting have one [Response]pickist and one checkbox [Response] TRUE/FALSE to update a Priority rating from the entries entered in these two above fields.:

  1. Field to Update
  2. List item
  3. Aftercare Priority Field Data Type Text

My field update formula is below,

CASE (1, 
IF ( ISPICKVAL ( AC_Aftercare_Response__c, “Email sent”), 
AND (AC_Aftercare_Bite_Incident__c, “FALSE”), “1”, 1,0), 8,
IF ( ISPICKVAL ( AC_Aftercare_Response__c, “Phoned, message left”), 
AND (AC_Aftercare_Bite_Incident__c, “FALSE”), “1”, 1,0), 7,
IF ( ISPICKVAL ( AC_Aftercare_Response__c, “Email sent”), 
AND (AC_Aftercare_Bite_Incident__c, “TRUE”), “1”, 1,0), 6,
IF ( ISPICKVAL ( AC_Aftercare_Response__c, “Phoned, message left”), 
AND (AC_Aftercare_Bite_Incident__c, “TRUE”), “1”, 1,0), 5,
IF ( ISPICKVAL ( AC_Aftercare_Response__c, “Phone, no option to leave message”), 
AND (AC_Aftercare_Bite_Incident__c, “FALSE”), “1”, 1,0), 4,
IF ( ISPICKVAL ( AC_Aftercare_Response__c, “no CBTA Response”), 
AND (AC_Aftercare_Bite_Incident__c, “FALSE”), “1”, 1,0), 3,
IF ( ISPICKVAL ( AC_Aftercare_Response__c, “Phone, no option to leave message”), 
AND (AC_Aftercare_Bite_Incident__c, “TRUE”), “1”, 1,0), 2,
IF ( ISPICKVAL ( AC_Aftercare_Response__c, “no CBTA Response”), 
AND (AC_Aftercare_Bite_Incident__c, “TRUE”), “1”, 1,0), 1,)

Error: Syntax error. Found ')'

Should I change the Checkbox: Bite Incident to a picklist ( Yes/No ) instead?

Advice would be welcomed. So close... What is the best option for this to work?

Kind regards

2
  • There are multiple syntax errors in the code. please go through the formula documentation to have a better understanding of the syntax. May 28, 2020 at 16:25
  • The detail is as follows, The new formula field: Priority ( will populate the custom text field a value 1, 2,3 4,5,6,7 or 8 pending the following selected values from an existing Field (picklist value) Response ( 1 of 4 values) to select and if the checkbox: Bite Incident is checked or not.) Example of upates from the end users. If (checkbox) Bite Incident = TRUE and (Picklist field) Response = no CBTA response then priority = 1 If Bite Incident = TRUE and Response = Phone, no option to leave message then priority = 2 May 28, 2020 at 19:02

1 Answer 1

0

You've got your syntax all turned around; I'm not sure how you got there at all. That said, it looks like the fix is easy enough:

CASE(
    AC_Aftercare_Response__c,
    "Email Sent", 6,
    "Phoned, message left", 5,
    "Phone, no option to leave message", 2,
    "no CBTA Response", 1, 0
) + 
IF(
    AC_Aftercare_Bite_Incident__c, 
    0, 
    IF(
        ISPICKVAL(AC_Aftercare_Response__c,""), 
        0, 
        2
    )
)

You'll want to read the documentation for CASE and IF to see how they work.

5
  • The detail is as follows, The new formula field: Priority ( will populate the custom text field a value 1, 2,3 4,5,6,7 or 8 pending the following selected values from an existing Field (picklist value) Response ( 1 of 4 values) to select and if the checkbox: Bite Incident is checked or not.) Example of updates from the end users. The custom field has to display _ {Priority} 1, 2,3,4,5,6,7 or 8 May 28, 2020 at 19:04
  • IF(AC_Aftercare_Bite_Incident__c = true, CASE(AC_Aftercare_Response__c, "Email sent", 6, "Phoned, message left", 5, "Phone, no option to leave message", 2, "no CBTA Response", 1, 0), CASE(AC_Aftercare_Response__c, "Email sent", 8, "Phoned, message left", 7, "Phone, no option to leave message", 4, "no CBTA Response", 3, 0) ) May 28, 2020 at 19:20
  • IF(AC_Aftercare_Bite_Incident__c = true, CASE(AC_Aftercare_Response__c, "Email sent", 6, "Phoned, message left", 5, "Phone, no option to leave message", 2, "no CBTA Response", 1, 0), CASE(AC_Aftercare_Response__c, "Email sent", 8, "Phoned, message left", 7, "Phone, no option to leave message", 4, "no CBTA Response", 3, 0) ) I tried this format: Error: Formula result is data type (Number), incompatible with expected data type (Text). Description Help Text May 28, 2020 at 19:21
  • @CharmsRhule Your original code was returning a number, so I stuck with it. If you need it as text, use TEXT(...original formula here...).
    – sfdcfox
    May 28, 2020 at 19:23
  • I have changed the formula: IF (AC_Aftercare_Bite_Incident__c = true, CASE(AC_Aftercare_Response__c, "Email sent", "6", "Phoned, message left", "5", "Phone, no option to leave message", "2", "no CBTA Response", "1", ""), CASE(AC_Aftercare_Response__c, "Email sent", "8", "Phoned, message left", "7", "Phone, no option to leave message", "4", "no CBTA Response", "3", "0") ) which now works May 29, 2020 at 9:13

You must log in to answer this question.

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