Required choice component behaviour when hidden

I have a choice dropdown D1 component. I’m filtering the values in the dropdown based on screen selections in previous dropdowns. So, when there is no match in the D1, the component is hidden altogether. The problem is that this is a required field in the form, and when it’s hidden, the system allows users to submit the form without filling this up.

According to Glide’s AI Agent, I can either have a default ‘No items to show‘ option or I can try and mark the field as required only when there is an option available. Both of these don’t help. In the first case, a user can select that option itself and submit the form. Second case won’t work because I want the field to always be filled. In the case where there are no options, I have a button to allow the user to add an entry which can then be selected.

Any better solution? Users are able to fill incomplete data right now and the app is behaving in unexpected ways.

The tricky thing here is determining when D1 would not have any choices. As you’re, I assume, in a normal form, the previous dropdowns’ values would be sandboxed inside the form.

My suggestion is converting this to a custom form if it isn’t too much to build again.

Write the choices to user-specific columns, so you can know on the fly where choices are available or not, and structure your submission availability around that.

There would also be a case where a user enters a choice (when D1 has available options), but then previous dropdown values change, leaving D1 with no options. In such cases, I would have a live list of available options for D1, and check if the chosen value at that moment is included in the list. Only validated if it’s included.

1 Like

Aah, changing to custom forms everywhere will be quite some task! I don’t think I can do that atm. Some components have a ‘Show when disabled‘ option. That would’ve been helpful here.

Unfortunately that’s the default behavior.

I think your other choice is to write all relevant choices to user profile columns so you have access to them outside of the form.

That way, you can also know when the choices are available or not, but you then must control the “Submit” button’s availability dynamically with CSS.