3

I need help creating this formula field. I am getting this error: 'Incorrect parameter type for function 'TEXT()'. Expected Number, Date, DateTime, Picklist, received Text (Related field: Formula)'

The field Today__c is a formula field that gets today's day(Monday ..... Friday) and Review_Day_s__c is a multi-pick_list field.

Formula:

IF(  INCLUDES(Review_Day_s__c, TEXT(Today__c)   )&& Review_Date__c  <  TODAY()  ,'Yes','No')

Error:

Incorrect parameter type for function 'INCLUDES()'. Expected Text Literal, received Text

0

2 Answers 2

3

When using the INCLUDES funtion, you have to use literal text. See help docs tip below:

Tips: The text_literal expression must be of type text and enclosed in quotes. It cannot be a merge field or the result of a function. Salesforce returns an error if any of the following occurs: You do not provide a text_literal expression. You provide an empty text_literal expression, such as "" or " ". Use ISBLANK to determine if a multi-select picklist field is empty. Use the PRIORVALUE function inside the INCLUDES function to check if the previous value of a multi-select picklist field included a specific value. For example: INCLUDES( PRIORVALUE(multiselect_picklist_field), text_literal )

0
0

If you need to replicate INCLUDES() in a flow or if you're willing to create a text field that stores a copy of the multi-select picklist field value, you can use the following strategy. (I've only tested in flow, but should work with custom fields too.)

  1. In a flow, directly assign the multi-select picklist value to a text variable using the Assignment element, or outside of flow, copy the multi-select picklist value to a custom text field using automation, like Workflow Rule, Process Builder, or Flow.
  2. In a flow, create a Boolean Formula using the below, or outside of flow, create a checkbox formula field using the below. (since multi-select picklists store the list as a semicolon-delimited string, the formula goes through the various scenarios in which an item could appear)

IF(ISBLANK({!Multi_Select_Field_Copy}), FALSE,

IF(!CONTAINS({!Multi_Select_Field_Copy}, ";"), {!Multi_Select_Field_Copy} = {!Merge_Field},

IF(CONTAINS({!Multi_Select_Field_Copy}, {!Merge_Field} + ";") || CONTAINS({!Multi_Select_Field_Copy}, ";" + {!Merge_Field}), TRUE,

FALSE)))

  1. Reference the boolean/checkbox formula created in Step 2 to determine whether your multi-select picklist field includes the value defined in the merge field.

You must log in to answer this question.

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