Allowing the user to add items to a choice component

Hi

Keen to hear anyones tips / thoughts on this.

I have a form which contains two choice components. The source for the choice components is set as a separate “Choices” table.

At the moment, if an option doesn’t exist - the users have to exit out of the form, and go to another tab which shows the list of choices and allows them to add. It’s rather clunky if you just want to quickly add one option.

Ideally I’d have a text box at the bottom of the form (overlay) - with a plus button next to it which allows the user to quickly enter the text and have it added to the list of available choices.

This is the closest I have got (using a helper table, and action row. Value is temporarily written to the helper table, then added to the table of choices via an action) - but has anyone a better way? I am sure I can get this looking better with a bit of CSS, but thought I’d check first).

Also tried adding a Data Grid component and allowing in cell editing - but that wasn’t great. Keen to avoid another overlay opening up.
![Screenshot 2024-10-09 at 09.41.23|378x500]

The best solution I can think of is to have another tree of logic in the action that runs when you submit the form, one that runs if the text box for a new choice is filled. It would take the value you’ve entered, set it as your choice, and then post the value in the choices table so it is available in the future.

If you’re looking to do this with more than one choice box, then you’d need branches for each, then all.

2 Likes

Oh that’s a good idea. Wasn’t my thought process at all - but this is much better (like a “or add an option here” text box). Cuts out a step over my method which was to add the choice option then have the user select it)

Will give it a go! Thanks

1 Like