> For the complete documentation index, see [llms.txt](https://docs.atfinity.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.atfinity.io/rule-language/operators/dictionary-operators/pick.md).

# pick

{% hint style="info" %}
**New in Atfinity 17.**
{% endhint %}

### Description

`pick` returns a new dictionary containing only the selected keys of the dictionary it is called on. The argument has the same shape as the argument to [`to_dict`](/rule-language/operators/dictionary-operators/to_dict.md): a dictionary literal whose keys are the names to pick from the source.

For each entry:

* If only a key is given (using the [dictionary shorthand](/rule-language/operators/dictionary-operators/shorthand.md), e.g. `first_name`), the resulting dictionary uses the same key name.
* If a value is given (e.g. `first_name: 'givenName'`), that value is used as the key in the resulting dictionary (i.e. the key is renamed).

Keys that are not present in the source dictionary are skipped and do not appear in the result.

### Examples

```
{'first_name': 'Thorben', 'last_name': 'Croisé', 'age': 42}.pick({first_name, last_name})
// => {'first_name': 'Thorben', 'last_name': 'Croisé'}
```

Renaming all picked keys:

```
some_dict.pick({first_name: 'givenName', last_name: 'familyName'})
// => {'givenName': '...', 'familyName': '...'}
```

Mixing shorthand and explicit renames:

```
some_dict.pick({first_name, last_name: 'familyName'})
```


---

# 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 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/dictionary-operators/pick.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.
