# CUSTOM\_MAX

### Description

`CUSTOM_MAX` returns the maximum element in a list as described by a second list. The second list gives the assigns a value to items in the first list in ascending order. If an element of the first list is not present in the second list, it is considered lower than all mentioned elements

### Example: Case colours

Given a list of case colours like `[red, green, green]` we would like to return the maximum as described by `[green, orange, red]`, where green means lowest value and red means highest value, so saying that red cases are most important:

```
CUSTOM_MAX([red, green, green, orange, green], [green, orange, red])
```

This will return `red`, as this is the maximum in the first list as described by the second list.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.atfinity.io/rule-language/operators/list-operators/custom_max.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
