Ask AI
Skip to main content

Set chips input field as required

Function: Set chips input field as required

This action allows you to control whether a "Chips Input Field" UI element on your application's form must be filled out by the user before they can submit the form. You can also customize the message displayed if the field is left empty when it's required.

Input

  • UI element (PART - Chips Input Field, Required): The specific "Chips Input Field" on your form that you want to modify. This is the element where users can enter multiple items (like tags or skills) as "chips."
  • Required (BOOLEAN, Required): Choose True if users must enter a value into this field. Choose False if leaving the field empty is allowed.
  • Required message (STRING, Optional): If you set the field as Required (True), this is the custom message that will appear to the user if they try to submit the form without filling out this field. If left empty, a default message like "This field is required" will be used.

Output

This function does not produce any direct output. It modifies the behavior of the selected UI element on your form.

Execution Flow

Real-Life Examples

Here are some ways you can use this action in your application:

  1. Making a "Skills" field mandatory for job applications:

    • Inputs:
      • UI element: Skills Chips Input Field
      • Required: True
      • Required message: Please list at least one skill.
    • Result: When a user applies for a job, they will be prompted with "Please list at least one skill." if they try to submit the application without adding any skills to the Skills field.
  2. Making a "Tags" field optional for blog posts:

    • Inputs:
      • UI element: Blog Post Tags Chips Input Field
      • Required: False
      • Required message: (Leave empty)
    • Result: Blog post authors can publish their posts without adding any tags if they choose, as the Tags field is no longer mandatory.
  3. Temporarily enforcing "Product Categories" selection during a campaign:

    • Inputs:
      • UI element: Product Categories Chips Input Field
      • Required: True
      • Required message: During the campaign, please select at least one product category.
    • Result: For the duration of the campaign, users creating new products must select at least one category, and they will see the custom message if they forget. After the campaign, you can change Required back to False.