# Form Basics

A simple form is a tool for collecting basic information from the user. It will contain a prompt for information and fields for the user to complete. Some good examples of simple forms are user sign-up or ticket information collection. This video starts with an introduction to a simple form that collects some user information and finishes by storing the data into [AirData](../../working-with-data/working-with-data-overview).

\[block:embed] { "html": "\<iframe class="embedly-embed" src="//cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FAoRcjWC5Q4Q%3Fstart%3D127%26feature%3Doembed%26start%3D127\&display\_name=YouTube\&url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DAoRcjWC5Q4Q\&image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FAoRcjWC5Q4Q%2Fhqdefault.jpg\&key=f2aa6fc3595946d0afc3d76cbbd25dc3\&type=text%2Fhtml\&schema=youtube" width="854" height="480" scrolling="no" title="YouTube embed" frameborder="0" allow="autoplay; fullscreen" allowfullscreen="true">", "url": "https://www.youtube.com/watch?v=AoRcjWC5Q4Q\&t=127s", "title": "Airkit 101 - Build Your First App in 10 Minutes", "favicon": "https://www.youtube.com/s/desktop/15c06292/img/favicon.ico", "image": "https://i.ytimg.com/vi/AoRcjWC5Q4Q/hqdefault.jpg" } \[/block]

#### The basics of creating a form

The simplest example of a form is a single-page form. This form consists of one Web Page to collect data. Single pages forms are best for small amounts of data collection. It is recommended to break large collection processes into steps. For information on how to create multi-page forms, check out our documentation on [Web Flows](../../studio/web-flows). This section covers forms that have only a few input boxes, or for some reason must be on the same page (legal or otherwise).

This example creates a simple form for submitting an issue with a book delivery from the fictitious AirBooks Library. It will prompt the user for their name, and the issue they are having and allow a place for them to enter additional notes. Here is the basic app before any fields have been added.

![AirBooks-Empty.png](https://1191388742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhOn9CLWoV9VfJeM5EDAa%2Fuploads%2Fgit-blob-d023c71a40ffe8d622ee28b0804bf24a9591a3c1%2Fform-basics-v1715-0.png?alt=media)

To start, add a [Container](../../web-controls/container-web-control) to the page, then put a [Label](../../studio/web-flows) and [Text Input](../../web-controls/text-input-web-control) inside the container. Change the text of the Label to "What is your name?". Text Inputs are used to collect smaller lines of text, like a name. When creating the Text Input, a Text Variable is created on the same Web Page as the input. Change the name by double-clicking the field, **string\_input**, and change it to name. Note that changing the reference on the Web Page will update the associated value on the Text Input automatically.

Create another [Container](../../web-controls/text-input-web-control), insert a Label reading "How can we help you today?" and a [Text Area Input](../../web-controls/text-area-web-control). Text Area Inputs are used for larger blocks of text. In this case a description of what the customer is requesting. Click on the Web Page to change the bound value from **text\_area** to **description**.

Lastly, add a [Button](../../web-controls/button-web-control) to the Web Page. Change the text on the button to "Submit". Buttons are used to perform [actions](../../studio/action-builder). In the case here, the button will submit the data that we have collected from the User.

The app should look something like this:

![](https://1191388742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhOn9CLWoV9VfJeM5EDAa%2Fuploads%2Fgit-blob-c428afcdee895dd6dbad706b606e695e6589185e%2Fform-basics-v1715-1.png?alt=media)

### How to submit form data

Once the customer information has been collected, it can be used in many different ways. For the purposes of this example, it will be used to create a Zendesk ticket. Before creating a Data Flow to create the ticket, the Zendesk Integration must be added to the App. Go to [Configuration Builder](../../studio/builder-bar/configuration-builder) and add a [Zendesk Integration](../integration-guides/zendesk-integration).

To send the data to Zendesk, go to [Connection Builder](../../studio/builder-bar/connection-builder) and create a new [Data Flow](../../studio/data-flows), name it _ZD - Create Ticket From Customer Issue_. Add two Text Inputs to the connection in the Inspector, one called **name** and the other **description**. Inputs are a way of passing external information to the Data Flows. Data Flows exist in their own scope and do not have access to any of the other [variable scopes](../../working-with-data/variable-scopes). The only way to get information into a Data Flow is to pass it in. Enter some test values for your input parameters in the stage of the Data Flow.

Select "Zendesk" from the drop-down on the Data Operation type. Select "Create Ticket" from the Operation drop-down. In the _Ticket Field&#x73;_&#x73;et the Subject value to:

```javascript
"Support Request from {{name}}"
```

This is a line of Airscript, setting the Subject to a custom string using the input variable **name** to indicate who is making the request. Find out more in [Working with Text in Airscript](../../airscript/working-with-text). Put the **description** value in the Description field. Running this connection step will produce a Zendesk Ticket.

![](https://a01-support.airkit.com/building-a-simple-form/SimpleFormZendeskRun.gif)

Looking at the payload from the response:

```javascript
{  
  "success": true,  
  "result": {  
    "ticket": {  
      ...  
      "subject": "Support Request from Molly Fey",  
      "raw_subject": "Support Request from Molly Fey",  
      "description": "I ordered a copy of the new Edward Tufte book and haven't recieved any shipping information yet. Might you be able to tell me when it will ship?",  
      ...  
    },  
    ...  
  },  
  "error": null  
}
```

The ticket has been created with the information passed in.

The last step is to connect the Data Flow to the Submit button on the form in App Builder. Select the Submit button, add a clicked Action. Under the "App" section, select the [Run Data Flow](../../actions/the-run-data-flow-repeatedly-action) action. Select the _ZD - Create Ticket From Customer Issu&#x65;_&#x64;ata flow from the list. Pass in the **name** and **description**, respectively.

![](https://1191388742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhOn9CLWoV9VfJeM5EDAa%2Fuploads%2Fgit-blob-3bbd81049b89be5eedb4ce2d241d972f071af63d%2Fform-basics-v1715-2.png?alt=media)

Running the App in Preview will submit a ticket every time the submit button is pressed. This is one example of how to use the data, but using an [HTTP Operation](../../data-operations/http-request-data-operation) it is possible to send this data to any external API.
