Issue with Required Field Validation in Input Field of Type Select #12814

Closed
opened 2026-02-21 19:09:12 -05:00 by yindo · 1 comment
Owner

Originally created by @HakureiAlice on GitHub (Apr 11, 2025).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.2.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

I encountered an issue with the Input Field of type "Select" in the workflow. Even when the "Required" option is unchecked, the field still becomes mandatory in both the "Explore" and "Run App" sections. If not selected, it triggers an error with the message:

"label in input form must be one of the following:"

✔️ Expected Behavior

Not selecting the field should allow successful

Actual Behavior

Not selecting the field causes an error upon submission.

Originally created by @HakureiAlice on GitHub (Apr 11, 2025). ### Self Checks - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.2.0 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce I encountered an issue with the Input Field of type "Select" in the workflow. Even when the "Required" option is unchecked, the field still becomes mandatory in both the "Explore" and "Run App" sections. If not selected, it triggers an error with the message: "label in input form must be one of the following:" ### ✔️ Expected Behavior Not selecting the field should allow successful ### ❌ Actual Behavior Not selecting the field causes an error upon submission.
yindo added the 🐞 buggood first issue labels 2026-02-21 19:09:12 -05:00
yindo closed this issue 2026-02-21 19:09:12 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Apr 11, 2025):

Hello @HakureiAlice! I'm Dosu, a bot here to help you solve bugs, answer questions, and guide you in becoming a contributor. I'm here to assist while you wait for a human maintainer. How can I help you today?

The issue you're experiencing with the 'Required' field validation for the 'Select' type input seems to be related to how the Dify platform handles the 'Required' attribute. In the Dify codebase, the 'Required' option for input fields of type 'Select' is implemented by setting the required attribute to true in the parameter configuration, which ensures that the user must select an option before proceeding [1].

However, if the 'Required' option is unchecked and the field still behaves as mandatory, it might be due to a bug or oversight in the code that doesn't properly account for the unchecked state. The logic for handling user configurations for 'Select' type inputs includes a default setting where required is true unless explicitly set to false [2]. This could be causing the issue if the unchecked state isn't correctly updating this attribute.

To address this, you might want to check the configuration logic in the relevant files, such as model-config.ts, to ensure that the required attribute is correctly set to false when the option is unchecked. Additionally, reviewing the validation logic in components like ChatUserInput and AppInputsForm might provide insights into where the error is being triggered [3][4].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (Apr 11, 2025): <!-- Greeting --> Hello @HakureiAlice! I'm [Dosu](https://dosu.dev), a bot here to help you solve bugs, answer questions, and guide you in becoming a contributor. I'm here to assist while you wait for a human maintainer. How can I help you today? <!-- Answer --> The issue you're experiencing with the 'Required' field validation for the 'Select' type input seems to be related to how the Dify platform handles the 'Required' attribute. In the Dify codebase, the 'Required' option for input fields of type 'Select' is implemented by setting the `required` attribute to `true` in the parameter configuration, which ensures that the user must select an option before proceeding <sup>[[1]](https://github.com/langgenius/dify/blob/main/api/core/tools/provider/builtin/podcast_generator/podcast_generator.yaml)</sup>. However, if the 'Required' option is unchecked and the field still behaves as mandatory, it might be due to a bug or oversight in the code that doesn't properly account for the unchecked state. The logic for handling user configurations for 'Select' type inputs includes a default setting where `required` is true unless explicitly set to false <sup>[[2]](https://github.com/langgenius/dify/blob/main/web/utils/model-config.ts)</sup>. This could be causing the issue if the unchecked state isn't correctly updating this attribute. To address this, you might want to check the configuration logic in the relevant files, such as `model-config.ts`, to ensure that the `required` attribute is correctly set to false when the option is unchecked. Additionally, reviewing the validation logic in components like `ChatUserInput` and `AppInputsForm` might provide insights into where the error is being triggered <sup>[[3]](https://github.com/langgenius/dify/blob/main/web/app/components/app/configuration/debug/chat-user-input.tsx)</sup><sup>[[4]](https://github.com/langgenius/dify/blob/main/web/app/components/plugins/plugin-detail-panel/app-selector/app-inputs-form.tsx)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/f7b2afe1-a95f-4c23-b4c9-36a6c38abd77?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/f7b2afe1-a95f-4c23-b4c9-36a6c38abd77?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/f7b2afe1-a95f-4c23-b4c9-36a6c38abd77?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/f7b2afe1-a95f-4c23-b4c9-36a6c38abd77?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/f7b2afe1-a95f-4c23-b4c9-36a6c38abd77?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/f7b2afe1-a95f-4c23-b4c9-36a6c38abd77?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/f7b2afe1-a95f-4c23-b4c9-36a6c38abd77?feedback_type=other)</sup>
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#12814