> For the complete documentation index, see [llms.txt](https://docs.decisionrules.io/doc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.decisionrules.io/doc/rules/data-types-and-functions/operators/functions/data.md).

# Data Functions

## List of data functions

* PICK
* RAW\_VALUE

### Pick a value from an array or object (PICK)

Given an array or object and a JSON path to certain value inside it, the PICK function picks this value and returns it.

* Takes 2 arguments, the array / object and the path.
* The first argument must be a variable or another function returning the object or array.
* The second argument must be a string specifying JSON path to the desired string values.

{% hint style="info" %}
The json path is simply the sequence of keys separated by dots. You can access elements in an array by writing the index of the element in square brackets behind the key pointing to that array. Note that elements in an array are indexed from 0! For example, animals\[0] points to the first element of the animals array.
{% endhint %}

#### PICK function examples:

```javascript
input1 = {"order":{"code":"A"}}

input2 = ["A", "B", "C"]

input3 = { "order": [ {"code":"A2", "price":22}, {"code":"B3", "price":11} ] }
 
[function] --> [output]

PICK({input1}, "order.code")        --> "A"
PICK({input2}, "[2]")               --> "C"
PICK({input3}, "order[0].code")     --> "A2"
PICK({input3}, "order[1].price")    --> 11
```

### Keep the same type without auto-casting (RAW\_VALUE)

For the given argument, it ignores auto-casting and the return value of the same type. In most cases, we want to call this function first, because the output of the function cell is automatically auto-casted, and this function prevents this behaviour.

* Take 1 argument of any type

#### RAW\_VALUE function examples:

```javascript
[function] --> [output]

RAW_VALUE(true)                  -->    true
RAW_VALUE(false)                 -->    false
RAW_VALUE("0001")                -->    "0001"
RAW_VALUE(11)                    -->    11
RAW_VALUE(null)                  -->    null
RAW_VALUE(TEXT(true))            -->    "true"
RAW_VALUE({"a": 10, "b": 20})    -->    {"a": 10, "b": 20}
RAW_VALUE(["a", "b", 1, 2])      -->    ["a", "b", 1, 2]
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.decisionrules.io/doc/rules/data-types-and-functions/operators/functions/data.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
