Skip to content

Data-driven max choices and multi-select limits for Choice component #37

@xcel97

Description

@xcel97

Feature Request: Data-driven max choices and multi-select limits for Choice component

Summary

Allow the Choice component’s “Max choices” and “Allow selecting multiple” settings to be driven by a data column (preferably a Number column, including computed), so selection limits can vary per row, per user, or per context.

Current Problem

The Choice component’s selection limits are static and set manually in the Builder. When different items, users, or contexts require different limits, builders must duplicate components or screens and manage complex visibility conditions. This is hard to maintain and error‑prone.

Examples / Scenarios

  • Tiered plans: “Features selectable” limit sourced from a user’s plan row (1 for Basic, 3 for Pro, 10 for Enterprise).
  • Inventory rules: “Max add-ons” bound to an item’s computed capacity (Math/ITE results), changing with stock or configuration.

Why This Matters

  • Reduces UI duplication and conditional logic maintenance.
  • Keeps logic centralized in data and computed columns.
  • Improves UX by reflecting real constraints from the dataset instantly.

Suggested UX

  • In Choice → Options → “Allow selecting multiple”: add “Bind to column…” supporting Boolean/Text (truthy/falsey).
  • In Choice → Options → “Max choices”: add “Bind to column…” supporting Number columns.
  • Supported sources: basic Number; Relation→Lookup Number; computed Math and If‑Then‑Else returning numbers.
  • Validation: non‑negative integers; if null/invalid, fall back to the static Builder value or a sensible default (e.g., 1).
  • Preview shows current row’s bound values; tooltips clarify fallback behavior.
Image Current Fallback setup example: https://share.xscorp.ca/vH9q0826

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions