I have a builder field that allows people to set up a list of credits like:
label: Credits
type: builder
fieldsets:
credit:
name: Credit
label: Credit
fields:
heading:
label: Heading
type: text
items:
label: People
type: tags
icon: users
options: query
query:
fetch: kirby.collection("people")
text: "{{ page.title }}"
value: "{{ page.autoid }}"
accept: options
The problem is that the query
wasn’t set to save the autoid
value originally, and thus what I have in a number of entries is the page slug/uri.
I am easily able to loop through all my items, grab the slug and fetch the corresponding autoid
but I’m struggling to understand how I can update the field accordingly with this value (except perhaps some kind of hacky regex on the field string).
Is there a way to programmatically set this field to replace the uri
with the autoid
?