# Brick forms with dynamic fields

**URL:** <https://discourse.haskell.org/t/brick-forms-with-dynamic-fields/9247>\
**Category:** Learn\
**Created:** [April 3, 2024, 5:14pm UTC](https://discourse.haskell.org/t/brick-forms-with-dynamic-fields/9247 "2024-04-03T17:14:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kushagarr](https://avatars.discourse-cdn.com/v4/letter/k/f05b48/32.png) [@kushagarr](https://discourse.haskell.org/u/kushagarr)\
**Post date:** [April 3, 2024, 5:14pm UTC](https://discourse.haskell.org/t/brick-forms-with-dynamic-fields/9247/1 "2024-04-03T17:14:10Z")

</div>

In [Brick.Forms](https://hackage.haskell.org/package/brick-2.3.1/docs/Brick-Forms.html) , the way to create a new form is that you have a Haskell data type with some pre defined fields which then become the corresponding input in the brick form.

> This module provides an input form API. This API allows you to construct an input interface based on a data type of your choice. Each input in the form corresponds to a field in your data type. This API then automatically dispatches keyboard and mouse input events to each form input field, manages rendering of the form, notifies the user when a form field’s value is invalid, and stores valid inputs in your data type when possible

I have a requirement where, I have, say a list of column names from a db table, and I want to make a brick form to insert a new row in the db table. Since I could select any db table at run time, the column names can change at run time. So at best the data type I can have is a thin wrapper around the list of column names.

How can I make brick form with such a data type? For simplicity lets assume, the form ,for all the input fields rendered, accepts only string values or Text values.

If I cannot make a form with such a data type, what are the alternatives?
