Multiselect field source in same page ( builder block)

Hi,

i want to fill a multiselect-field by another field in the same page. i tried… and tried… and tried… but it seems i’m not familiar enough with the syntax… =(
This is done in a builder block
any idea on this?

    fields:
      # cards-iCal
      link: 
        label: 
          en: Link
          de: Link
        type: text
        maxlength: 256
        width: 1/1
      catLocations:
        label: 
          en: Location Categories
          de: Ort Kategorien
        type: structure
        catLocations: 
          catLocationsCat: 
            width: 1/3
          catLocationsText: 
            width: 2/3
        fields:
          catLocationsCat: 
            label: 
              en: Category
              de: Kategorie
            type: text
            maxlength: 30
            width: 1/3
          catLocationsText: 
            label: 
              en: Markdown
              de: Markdown
            type: textarea
            size: medium
            width: 2/3
          mymap:
            label: Location
            type: locator
          multiselect:
            label: Multiselect
            type: multiselect
            options: query
            query: 
              fetch: page.catIcons.toStructure
              text: "{{ structureItem.catIconsCat }}"
              value: "{{ structureItem.catIconsUiKit }}"
      catGrouping:
        label: 
          en: Grouping Categories
          de: Grouping Kategorien
        type: structure
        catGrouping: 
          catGroupingCat: 
            width: 1/3
          catGroupingText: 
            width: 2/3
        fields:
          catGroupingCat: 
            label: 
              en: Grouping Category
              de: Grouping Kategorie
            type: text
            maxlength: 30
            width: 1/3
          catGroupingText: 
            label: 
              en: Markdown
              de: Markdown
            type: textarea
            size: medium
            width: 2/3
      catIcons:
        label: 
          en: Icon Categories
          de: Icon Kategorien
        type: structure
        catIcons: 
          catIcons: 
            width: 1/3
          catIconsText: 
            width: 2/3
        fields:
          catIconsCat: 
            label: 
              en: Icon Category
              de: Icon Kategorie
            type: text
            maxlength: 30
            width: 1/3
          catIconsUiKit: 
            label: 
              en: Icon Name
              de: Icon Name
            type: text
            help: name of icon - see https://getuikit.com/docs/icon
            maxlength: 30
            width: 1/3
          catIconsUiKitRatio: 
            label: 
              en: Icon Ratio
              de: Icon Ratio
            type: number
            help: Add the ratio 2 parameter to the uk-icon attribute to double its size – or any other number, depending on how big you want you icon to be.
            step: .1
            default: 1.4
            placeholder: 1.4
            min: 0
            max: 3
            width: 1/3

----

Modules:

- 
  link: https://testlink
  catlocations:
    - 
      catlocationscat: testcat1
      catlocationstext: testmarkdown1
      mymap:
        lat: 51.1576661
        lon: -1.4458572
        city: Test Valley
        country: Vereinigtes Königreich
        postcode: SO20 6AZ
      multiselect: ""
    - 
      catlocationscat: testcat2
      catlocationstext: testmarkdown2
      mymap:
        lat: 51.1576661
        lon: -1.4458572
        city: Test Valley
        country: Vereinigtes Königreich
        postcode: SO20 6AZ
      multiselect: ""
  catgrouping: [ ]
  caticons:
    - 
      caticonscat: testiconcat1
      caticonsuikit: testiconname1
      caticonsuikitratio: 1.4
    - 
      caticonscat: testiconcat2
      caticonsuikit: testiconname2
      caticonsuikitratio: 1.4
  title: ""
  _key: cards-ical
  _uid: cards-ical_1601770188946_159

----

It would probably be best to move the logoc into a page model. Since this is inside a builder field as you say, you would have to convert to builder field into blocks, then filder by the block type that contains the structure field that in turn contains the caticons etc. and in the end combine all results into an array.

And in the end, this would only give you the icons that are already stored, not the ones that live in those items that haven’t be saved yet.

thx @texnixe,

i’m currently rethinking my whole setup/idea…

It was about a place to hold ressources that are selectable in a multiselect field…

so… what about something like this:

is it possible to get those values like “pasta - lasgagne” into a multiselect field on a seperate blueprint?
What would be the query/fetch syntax?

Yes, that would be possible. If you just have one structure field, you can use the query from the docs.

If you want to combine options from multiple structure fields, you can use a page model method to generate a single structure, then query that.

Or use a route to generate JSON with all options from all fields.