Query a tab structure for a select

Hello,

i have a tab called “configurator” in the site.yml where a user can create screens. Inside a screen he can create buttons and link them to other screens. I can’t find out how to query the allready existing screens to populate the select box.

configurator:
    label: Configurator
    icon: cog
    fields:
      screens:
        label: Screens
        type: structure
        fields:
          title:
            label: Title
            type: text
          buttons:
            label: Buttons
            type: structure
            fields:
              buttonTitle:
                label: Button Title
                type: text
              nextScreen:
                label: Next Screen
                type: select
                options:
                  query: site.tabs.find('configurator').fields.screens.toStructure()
                  value: "{{ option.id }}"
                  text: "{{ option.title }}"

What am i doing wrong?

Thank you in advance.

See docs: Select | Kirby CMS

Thank you, i allready saw this page in the docs, but i can’t find out what i am doing wrong which is the reason why i am asking in the forum.

found the problem with chat gpt. thanks anyways.

Oh, I see, you are trying to select stuff inside a nested structure field. Apart from the fact that all fields are equal (no matter the tab in which they live), I’m afraid this will not work as expected, because the page would have to be saved before you can access stuff from the same page.

1 Like

Thank you. Yes i was clear about that the screens needs to be saved before. The query was wildly wrong. I need to dive deep into querying all the posibilities in kirby again.