Documentation

Numeric Grid Question

Article

Numeric Grid Question

When and Why to Use

Use this to capture numeric input across a grid of rows and columns. Best for:

  • Time allocation or quantity distribution
  • Budget breakdowns
  • Structured numeric input across categories

Supports autosumming, recoding, and custom validation.

Chat Style
  • Each row is presented with numeric input fields for each column
  • Users enter numbers directly
Traditional Style
  • Full grid visible with scrollable columns if needed
  • Easier comparison across multiple categories
  • Autosums are enabled
Chat styleTraditional with imagesMobile optimized
Markdown 2B 2B 2BImagesText Images485789795 cd978f27 8e25 4c30 b38f 6a09795937df
Configuration Options
OptionTypeRequiredDefaultDescription
questionstringyes-The prompt shown to the user
rows`List[strMediaItem]`yes-
row_namestringyes-Reporting label for rows
columnsList[str]no-Column labels
column_namestringno-Reporting label for columns
imageMediaItemno-Top-level image
min_maxTuple[int, int]no(1, 100)Range of acceptable numeric values
randomizeboolnoFalseRandomize row order
randomize_columnsboolnoFalseRandomize column order
recodesDict[str, str]no-Optional recoding logic
default`Dict[str, intDict[str, int]]`norandom
autosum_columnsboolnoFalseAutomatically sum across rows for each column
autosum_rowsboolnoFalseAutomatically sum across columns for each row
custom_validator`Callable[[Dict[str, Any]], strNone]`no-
image_label_fieldstrno-Used to label media row items
show_image_labelboolnoTrueShow/hide labels for row images
image_sizeTuple[int, int]no-Bounding box for images
tagss.tag()no-Token substitution and reporting group
Example Code

Basic usage:

s.grid_numeric_question( "How many hours do you spend per week on the following activities?", row_name="Activity", rows=["Work", "Sleep", "Exercise", "Socializing"], columns=["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"] )

With recodes and autosum:

s.grid_numeric_question(
    "Distribute your budget across categories",
    row_name="Category",
    rows=["Food", "Housing", "Entertainment"],
    columns=["January", "February", "March"],
    recodes={
        "0-30%": "Low",
        "31-70%": "Medium",
        "71-100%": "High"
    },
    autosum_rows=True
)

With custom validation:

s.grid_numeric_question(
    "How many units of each product did you sell?",
    row_name="Product",
    rows=["Item A", "Item B"],
    columns=["Online", "In-store"],
    custom_validator=lambda d: "Please don't enter the same number for every cell"
        if len(set([v for r in d.values() for v in (r if isinstance(r, dict) else [r])])) == 1
        else None
)
Notes
  • Use autosum_columns or autosum_rows to show real-time totals
  • Recodes are especially helpful for analysis of numeric ranges
  • Validator helps detect lazy input (e.g. straight-lining)