pen-to-squareInputs

Inputs in Gromet define the parameters your users will see in the Form tab, and how they’re passed to your Python script.

Each input is declared in the YAML under a single inputs key (see Quickstart). Gromet then auto-generates a form and wires the responses into your main() function.

General Input Format

Each input in the YAML supports the following common keys:

  • arg: The argument name passed to your Python main() function. Must match your function parameter name exactly.

  • title: The label shown in the form UI.

  • type: The input type (e.g., file, text, dropdown, multiselect, textarea, date).

  • required: Boolean (true or false) indicating if the input is mandatory. Default is false.

  • placeholder: Optional placeholder text shown inside text or textarea inputs.

  • extensions: For file inputs, a list of allowed file extensions (e.g., [xlsx, xls]).

  • options: For dropdowns and multiselects, a list of selectable options, each with value and label.

Notes:

  • Inputs are passed to main() in the order they appear in the YAML list.

  • Optional inputs not provided will be passed as None.

Below are the supported input types:


📂 file

YAML:

Python:

▫️ The input is passed as a local file path string to your Python function.

▫️ To enable all file extensions pass an empty array as the value i.e extensions: []


🔤 text

YAML:

Python:

▫️ The value is passed as a string.


📝 textarea

YAML:

Python:

▫️ Multi-line text, passed as a string.


YAML:

Python:

▫️ Passed as a string matching the selected value.


🧑‍🤝‍🧑 multiselect - Select multiple inputs from a range of options

YAML:

Python:

▫️ Passed as a list of strings (the values of the selected options).


🗓️ date

YAML:

Python:

▫️ Passed as a string in YYYY-MM-DD format.


☑️ checkbox

YAML:

Python:

  • Python receives the checkbox value as a native bool type — no manual string-to-boolean conversion needed.

  • This seamless conversion is handled automatically by the Gromet input system.

  • If the checkbox is required, the form enforces it must be checked (True) before submission.

  • Frontend still stores the state as a string internally for simplicity.


🧪 Notes

  • All arg names must match the function parameters in main()

  • Inputs are passed in positional order (by YAML list order)

  • Optional fields will be passed as None if not provided

Last updated