# Form: Setting a variable-length array of fields

**URL:** <https://forum.mautic.org/t/form-setting-a-variable-length-array-of-fields/24097>\
**Category:** Product Support\
**Created:** [May 14, 2022, 3:07pm UTC](https://forum.mautic.org/t/form-setting-a-variable-length-array-of-fields/24097 "2022-05-14T15:07:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![xmontero](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/xmontero/32/7499_2.png) [@xmontero](https://forum.mautic.org/u/xmontero)\
**Post date:** [May 14, 2022, 3:07pm UTC](https://forum.mautic.org/t/form-setting-a-variable-length-array-of-fields/24097/1 "2022-05-14T15:07:59Z")

</div>

Mautic version: 4

I want to ask this information in a form:

1. Number of invitees you are willing to bring to an event
2. Your data: Name, Lastname, email, phone, age
3. Invitee’s data: FOR EACH invitee: Name, and if they are adult/child.

I want for example if Alice comes with Bob (his husband) and Charlie and Dan, their kids, to enter this:

Section 1:  
Invitees appart from you: 3

Section 2:  
Name: Alice  
Last Name: Smith  
Email: [alice@example.com](mailto:alice@example.com)  
Phone: 666 666 666  
Age: 28

Section 3:  
Invitee1\_Name: Bob  
Invitee1\_Kid: no  
Invitee2\_Name: Charlie  
Invitee2\_Kid: yes  
Invitee3\_Name: Dan  
Invitee3\_Kid: yes

But if you don’t bring more invitees, hide those fields.  
Or if you bring, say, 10 invitees, 10 sets of 2 fields (name + kid) are automatically created.

How can I do this?
