MAP_VALUE_STARTS_WITH_IGNORE_CASE
Description
Returns the corresponding return_value for the first compare_substring that matches the beginning of the provided string, performing case-insensitive matching. 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_STARTS_WITH_IGNORE_CASE(string, ...[compare_substring, return_value], default_return_value_optional)-> Object
Parameters
| Parameter | Data Type | Required | Description |
|---|---|---|---|
| string | String | Yes | The string to evaluate (case-insensitive). |
| … compare_substring | String | Yes | The substring to match at the beginning of the provided string. |
| … return_value | Object | Yes | The value returned if compare_substring matches. |
| 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_STARTS_WITH_IGNORE_CASE("ca-san francisco", "CA", "California", "NY", "New York", "Other")
-- Returns "California"(case-insensitive).MAP_VALUE_STARTS_WITH_IGNORE_CASE(Description, "platinum", "Partner", "individual", "Person")
-- Returns "Partner" if Description starts with "platinum".
-- Returns "Person" if it starts with "individual".
-- Returns $SKIP_ASSIGNMENT otherwise.
-- Matching is case-insensitive and stops at the first match.Tips
Ensure that return_value and default_return_value_optional are of the same data type.