Store field value and autocomplete on other instances of field

Hello,

Is there any built-in way to store user inputted values for a particular field, then provide these values as autocomplete or similar options for every new instance of this field ?

For example, user can add instances of a "groceries list’ page to the panel. The page contains text fields. The user fills the fields with groceries. Then next time user adds a ‘groceries list’ page, all previously added groceries are suggested to user when writing in the field, in an autocomplete fashion… or similar?

Thanks!

No, there is no built-in field with autocompletion apart from the tags field (and the email field, but that just on a side note). You would have to create a custom field that uses the autocompletion API.

What does your grocery list page look like, so that we get a better understanding of what you are trying to achieve. Multiple text fields with one entry per field? A comma separated list per field?

Thank you,

The grocery list was a made up example.

The real case would be an event. The user can create an edition (2 per year) of this event, which through builder in the blueprint, creates a tree of categories, such as exhibitors.

If in 2017 the user wrote the name of a couple of exhibitors, I’d like for these names to be easily available when filling names for the next edition, say 2018. That’s why I ask for autocomplete.

This is not built yet. I had imagined a list of text fields, but most possibly structure fields (name, url, image per exhibitor).

One alternative would be to have a page dedicated to store exhibitor data in structure fields, which can be then say invoked in the current edition’s exhibitor page. But that would be something completely different, I imagine.

Where is the autocompletion API documented?

Thank you!

I would store the list of exhibitors in subpages or a structure field and then use a multi-select field in the event page. Maybe add an option to add an exhibitor on the fly without having to go to the page where the exhibitors are stored (either via a separate field or as an extension to the multi-select field).

Thanks for the tip.

About the autocompletion API, is that documented anywhere ? or maybe only to be understood from source ?

There is no documentation that I’m aware of, check the source code of the tags field.

1 Like