I have a structure field on a page like this:
form_fields:
type: structure
label: Form Fields
fields:
form_field_name:
type: text
label: Field Name
form_field_class:
type: text
label: Field Class
form_field_structure:
type: toggle
label: Field Structure
default: false
text:
- plain element
- enclose in <div>
I’d like to create a SELECT field now, on the same page, which should have selections based on the entries in that field. I’m trying this:
form_key_field:
type: select
label: Key Field
options: query
query:
fetch: page.form_fields.toStructure
text: "#{{ structureItem.form_field_name }}"
value: "{{ structureItem.form_field_name }}"
But all I get is an error message where the select field should be, which says:
Error in "form_key_field" field:
Invalid query result data
I’ve also tried using yaml
+ arrayItem
in the query, instead of toStructure
and structureItem
, but got same result.
Any suggestions would be greatly appreciated.