MAP_VALUE_CONTAINS
Description
Returns the corresponding return_value for the first compare_substring found within the provided string (case-sensitive). If no substrings match, returns default_return_value_optional. If default_return_value_optional is omitted and no matches occur, the function returns $SKIP_ASSIGNMENT.
Syntax
MAP_VALUE_CONTAINS(string, ...[compare_substring, return_value], default_return_value_optional)-> Object
Parameters
| Parameter | Data Type | Required | Description |
|---|---|---|---|
| string | String | Yes | The string to evaluate (case-sensitive). |
| … compare_substring | String | Yes | The substring to search for within the provided string. |
| … return_value | Object | Yes | The value returned if the compare substring is found. |
| default_return_value_optional | Object | No | The value returned if no substrings match. If omitted and no match occurs, returns $SKIP_ASSIGNMENT. |
Examples
MAP_VALUE_CONTAINS("New York - Office", "new york", "NY", "California", "CA", "Other")
-- Returns "Other" (case-sensitive).MAP_VALUE_CONTAINS(Description, "Platinum", "Partner", "Individual", "Person")
-- Returns "Partner" if Description contains "Platinum".
-- Returns "Person" if it contains "Individual".
-- Returns $SKIP_ASSIGNMENT otherwise.
-- Matching is case-sensitive and stops at the first match.Tips
Ensure that return_value and default_return_value_optional are of the same data type.