Structure field - how to query options depending on a field from the same row

Hi everyone,

In a structure field, is it possible to query options from another structure field located in the parent page, but also depending on a the content of field from the same row ?

Explanations,
A repository.php page contains a card.php page.
The repository.yml parent blueprint contains a structure field for creating filters :

          filters:
            type: structure
            fields:
              category:
                type: text
              options:
                type: tags

The card.yml child blueprint contains the inheritedFilters, using a inherited-editable-structure field plugin that extends the original structure field.
The plugin initialize the field with rows coming from the parents. In each row, the category is fullfilled regarding the parent and locked but the tags must be editable. The options must match those defined in the parent structure field, in the row that has the same category.

      inheritedFilters:
        type: inherited-editable-structure
        fields:
          category:
            type: text
          options:
            type: tags
            options:
              type: query
              query: ???

I tried different approaches, using queries, custom field props logics, custom site methods, programmable blueprints…. I keep failing at getting the category of the current row so I can’t get the corresponding options.

Hope my explanations are clear. Do you have any idea ?

Thanks a lot for your help.

Please don’t hesitate to tell me if I shloud clarify something (or everything).

This is nothing that can be done on the blueprint side, because you would need a listener somewhere that listens to changes in the one field to then fetch the relevant options for the other field on the fly. And this can only be done on the front end.

Ok, that’s what I thought. I started to work in that direction. I’m working on a custom structure field but I have difficulties to come down to the tags field.
My idea is to pass a prop from the extended structure field that order to the tags field the behavior I want. I started by duplicating the StructureField.vue code found in the repo and it works. To come down to the tags field, I replaced the <k-structure-form>component with the StructureForm.vue code :

    <StructureForm
      v-if="currentIndex !== null"
      ref="form"
      :fields="form"
      :index="currentIndex"
      :total="items.length"
      :value="currentModel"
      @close="onFormClose"
      @discard="onFormDiscard"
      @input="onFormInput"
      @paginate="onFormPaginate($event.offset)"
      @submit="onFormSubmit"
    />

The StructureForm component is properly imported but it doesn’t work at this step. When I open the form I get an error : HTMLElement.focus: Argument 1 can't be converted to a dictionary.:

It seems to be linked to the ref="form" param, and indeed if I remove it removes the error. But the form still doesn’t show on click on the structure field.

Do you have any idea ? Is it at least a good approach ?