# Query multiselect options from another template for select field

**URL:** <https://forum.getkirby.com/t/query-multiselect-options-from-another-template-for-select-field/23760>\
**Category:** Questions\
**Tags:** v3\
**Created:** [October 23, 2021, 10:49am UTC](https://forum.getkirby.com/t/query-multiselect-options-from-another-template-for-select-field/23760 "2021-10-23T10:49:14Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![philipptrenz](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/philipptrenz/32/11084_2.png) [@philipptrenz](https://forum.getkirby.com/u/philipptrenz)\
**Post date:** [October 23, 2021, 10:49am UTC](https://forum.getkirby.com/t/query-multiselect-options-from-another-template-for-select-field/23760/1 "2021-10-23T10:49:14Z")

</div>

Hey there,

I’m using a multiselect field on a page blueprint to provide a filter option in the frontend. Now I want my client on another page to be able to select one of the options using a select field.

At `site/blueprints/pages/project.yml` the options are defined:

```auto
title: Project

status:
  draft: true
  listed: true

columns:
  - width: 2/3
    fields:
      cover: fields/cover
  - width: 1/3
    fields:
      categories:
        type: multiselect
        label: Categories
        translate: false
        options:
          0_corporate: Corporate
          1_packaging: Packaging
          2_illustration: Illustration
          3_animation: Animation
          4_print: Print
...

```

And at `site/blueprints/pages/home.yml` I would like to query them:

```auto
title: Home

status:
  draft: false
  listed: true

title: Home

columns:
  ...

  - width: 1/3
    sections:
      categorySection:
        type: fields
        fields:
          selectedCategory:
            label: Filter
            type: select
            options: query
            query: ???
  ...

```

Many thanks in advance!

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [October 23, 2021, 10:52am UTC](https://forum.getkirby.com/t/query-multiselect-options-from-another-template-for-select-field/23760/2 "2021-10-23T10:52:14Z")

</div>

> [@philipptrenz](#):
>
> `query: ???`

```auto
query: site.categories.split(',')

```

> **[Select](https://getkirby.com/docs/reference/panel/fields/select#options-from-other-fields)**
>
> A simple selectbox field

---

<div class="post-metadata">

**Author:** ![philipptrenz](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/philipptrenz/32/11084_2.png) [@philipptrenz](https://forum.getkirby.com/u/philipptrenz)\
**Post date:** [October 23, 2021, 10:58am UTC](https://forum.getkirby.com/t/query-multiselect-options-from-another-template-for-select-field/23760/3 "2021-10-23T10:58:57Z")

</div>

Oh wow, you’re fast! Thanks!

That didn’t work. I think I have to query for the `project` blueprint?

---

<div class="post-metadata">

**Author:** ![philipptrenz](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/philipptrenz/32/11084_2.png) [@philipptrenz](https://forum.getkirby.com/u/philipptrenz)\
**Post date:** [October 23, 2021, 11:20am UTC](https://forum.getkirby.com/t/query-multiselect-options-from-another-template-for-select-field/23760/4 "2021-10-23T11:20:51Z")

</div>

Maybe to be a bit more clear: I don’t want to query for the set values on a page, but all options defined in the `categories` options. Alternatively a `set` of all selected categories of all `project` pages would also be fine.

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [October 23, 2021, 11:34am UTC](https://forum.getkirby.com/t/query-multiselect-options-from-another-template-for-select-field/23760/5 "2021-10-23T11:34:58Z")

</div>

Oops, I didn’t look close enough and thought those categories were defined in the site blueprint.

To get all used categories from the project pages:

```auto
query: site.find('projects').children.listed.pluck('categories', ',', true)

```

---

<div class="post-metadata">

**Author:** ![philipptrenz](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/philipptrenz/32/11084_2.png) [@philipptrenz](https://forum.getkirby.com/u/philipptrenz)\
**Post date:** [October 23, 2021, 12:31pm UTC](https://forum.getkirby.com/t/query-multiselect-options-from-another-template-for-select-field/23760/6 "2021-10-23T12:31:25Z")

</div>

awesome, thank you!
