# Select from structure field of another page

**URL:** <https://forum.getkirby.com/t/select-from-structure-field-of-another-page/13586>\
**Category:** Questions\
**Tags:** v3\
**Created:** [March 29, 2019, 9:50am UTC](https://forum.getkirby.com/t/select-from-structure-field-of-another-page/13586 "2019-03-29T09:50:18Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![peterp](https://avatars.discourse-cdn.com/v4/letter/p/ccd318/32.png) [@peterp](https://forum.getkirby.com/u/peterp)\
**Post date:** [March 29, 2019, 9:50am UTC](https://forum.getkirby.com/t/select-from-structure-field-of-another-page/13586/1 "2019-03-29T09:50:18Z")

</div>

Hi all,

i want to use the data from a structure field of a second page in a select.

```auto
  options: query
         query:
          fetch: home.categories.toStructure
          text: "{{ structureItem.text }}"
          value: "{{ structureItem.key }}"

```

does not work, any ideas?

thx

---

<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:** [March 29, 2019, 9:52am UTC](https://forum.getkirby.com/t/select-from-structure-field-of-another-page/13586/2 "2019-03-29T09:52:12Z")

</div>

You have to tell Kirby what `home` is…

```auto
fetch: site.find("home").categories.toStructure

```

---

<div class="post-metadata">

**Author:** ![peterp](https://avatars.discourse-cdn.com/v4/letter/p/ccd318/32.png) [@peterp](https://forum.getkirby.com/u/peterp)\
**Post date:** [March 29, 2019, 10:10am UTC](https://forum.getkirby.com/t/select-from-structure-field-of-another-page/13586/3 "2019-03-29T10:10:24Z")

</div>

same result: the selectbox shows: “{{ structureItem.text }}”  
it is a child page from home: page.parent.categories.toStructure does not work ,too.

---

<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:** [March 29, 2019, 10:14am UTC](https://forum.getkirby.com/t/select-from-structure-field-of-another-page/13586/4 "2019-03-29T10:14:05Z")

</div>

So in which page exactly is the field? You have to pass the path to the right page. If it is not in the home page, then the above will not work, of course.

And what are the fields in the structure field called?

---

<div class="post-metadata">

**Author:** ![peterp](https://avatars.discourse-cdn.com/v4/letter/p/ccd318/32.png) [@peterp](https://forum.getkirby.com/u/peterp)\
**Post date:** [March 29, 2019, 10:18am UTC](https://forum.getkirby.com/t/select-from-structure-field-of-another-page/13586/5 "2019-03-29T10:18:47Z")

</div>

the fields are:

```
  key:
          label: kex
          type: text
        text:
          label: text
          type: text

```

the page is in home/about

i want to get data from the home field in the home/about page.

---

<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:** [March 29, 2019, 10:21am UTC](https://forum.getkirby.com/t/select-from-structure-field-of-another-page/13586/6 "2019-03-29T10:21:01Z")

</div>

> [@texnixe](#):
>
> fetch: site.find(“home”).categories.toStructure

Then

```auto
fetch: site.index.find("home/about").categories.toStructure

```

Or to prevent using index

```auto
fetch: site.find('home').children.find('about').categories.toStructure

```

---

<div class="post-metadata">

**Author:** ![peterp](https://avatars.discourse-cdn.com/v4/letter/p/ccd318/32.png) [@peterp](https://forum.getkirby.com/u/peterp)\
**Post date:** [March 29, 2019, 10:23am UTC](https://forum.getkirby.com/t/select-from-structure-field-of-another-page/13586/7 "2019-03-29T10:23:36Z")

</div>

sorry… the structure field i want to get the data from is in home.  
and in home/about i want to select the data from the structure field of the home page.  
so: site.find(“home”). should be correct but gives the result above.

---

<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:** [March 29, 2019, 10:24am UTC](https://forum.getkirby.com/t/select-from-structure-field-of-another-page/13586/8 "2019-03-29T10:24:23Z")

</div>

Then please post the blueprint of the home page. It doesn’t matter where you want to fetch the data but where you want to fetch it from.

---

<div class="post-metadata">

**Author:** ![peterp](https://avatars.discourse-cdn.com/v4/letter/p/ccd318/32.png) [@peterp](https://forum.getkirby.com/u/peterp)\
**Post date:** [March 29, 2019, 10:28am UTC](https://forum.getkirby.com/t/select-from-structure-field-of-another-page/13586/9 "2019-03-29T10:28:24Z")

</div>

this is the structure field in the home blueprint.

```auto
categories:
          label: Kategorien
          type: structure
          style: table
          required: true
          fields:
            key:
              label: kex
              type: text
            text:
              label: text
              type: text
            sequence:
              label: Reihenfolge
              type: number

```

---

<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:** [March 29, 2019, 10:34am UTC](https://forum.getkirby.com/t/select-from-structure-field-of-another-page/13586/10 "2019-03-29T10:34:54Z")

</div>

The what I originally posted above should work. But maybe your indentation for the select field is wrong.

It should look like this, i.e. with `options` and `query` on the same level in the indentation hierarchy.

```auto
fieldname:
  label: Select field
  type: select
  options: query
  query:
    fetch: site.find('home').categories.toStructure
    text: “{{ structureItem.text }}”
    value: “{{ structureItem.key }}”

```

In the future, could you please wrap blocks of code within 3 backticks on a new line before and after the code block.

---

<div class="post-metadata">

**Author:** ![peterp](https://avatars.discourse-cdn.com/v4/letter/p/ccd318/32.png) [@peterp](https://forum.getkirby.com/u/peterp)\
**Post date:** [March 29, 2019, 11:51am UTC](https://forum.getkirby.com/t/select-from-structure-field-of-another-page/13586/11 "2019-03-29T11:51:38Z")

</div>

Hi,

lol it works with your code. It was my blueprint formatting. And yes i’ll wrap the code.  
thanks for your help!
