> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flowforma.com/llms.txt
> Use this file to discover all available pages before exploring further.

# FlowForma Reporting - Exporting form data to SQL database

> Set up a FlowForma Reporting SQL connection to export form, flow, step, and question data into database tables that refresh hourly for reporting.

**FlowForma** now allows you to set a connection to an SQL database and export form data to tables that are created and populated by **FlowForma**.

When the reporting feature is enabled in **FlowForma**, a link labeled **FlowForma reporting connections** is displayed in the general panel of [FlowForma settings](/product/flowforma-settings/overview).

<img src="https://mintcdn.com/flowforma/46u--5D7TPNcEo4x/images/product/flowforma-reporting/flowforma-reporting-exporting-form-data-to-sql-database/flowforma-reporting-exporting-form-data-to-sql-database-1.png?fit=max&auto=format&n=46u--5D7TPNcEo4x&q=85&s=c43cf691d490cd251b9328efc41a92c0" alt="FlowForma reporting connections link in general panel" width="698" height="842" data-path="images/product/flowforma-reporting/flowforma-reporting-exporting-form-data-to-sql-database/flowforma-reporting-exporting-form-data-to-sql-database-1.png" />

To create a connection to a database, click the link. The screen below is displayed.

<img src="https://mintcdn.com/flowforma/46u--5D7TPNcEo4x/images/product/flowforma-reporting/flowforma-reporting-exporting-form-data-to-sql-database/flowforma-reporting-exporting-form-data-to-sql-database-2.png?fit=max&auto=format&n=46u--5D7TPNcEo4x&q=85&s=b36f320fc76219692deb94604856be09" alt="FlowForma reporting connections screen" width="695" height="500" data-path="images/product/flowforma-reporting/flowforma-reporting-exporting-form-data-to-sql-database/flowforma-reporting-exporting-form-data-to-sql-database-2.png" />

Click the **Add SQL connection** button. The following screen is displayed.

<img src="https://mintcdn.com/flowforma/46u--5D7TPNcEo4x/images/product/flowforma-reporting/flowforma-reporting-exporting-form-data-to-sql-database/flowforma-reporting-exporting-form-data-to-sql-database-3.png?fit=max&auto=format&n=46u--5D7TPNcEo4x&q=85&s=ffa18ca7364dfbb09741156da6c7d475" alt="Add SQL connection screen" width="676" height="401" data-path="images/product/flowforma-reporting/flowforma-reporting-exporting-form-data-to-sql-database/flowforma-reporting-exporting-form-data-to-sql-database-3.png" />

**AppInstanceId**: This provides a user-friendly name for the site so it can be identified easily in the database, and it can be used as a filter in reports to return information from this site only<br />
**Server**: The URL of the server hosting your SQL database<br />
**Database**: The name of the database where you want the FlowForma tables created<br />
**SQL user name**: The name of a SQL user that has permissions to update the database and tables above<br />
**Password**: The password of the SQL user above<br />
**Region**: You can select the region that your database is hosted in<br />
**Include Archive**: You can decide to include or exclude archived forms from the extract<br />
**Include Auditing**: If you have auditing enabled on your site, you can decide to create a table to store form audit data<br />
**Include Voting**: If you have the Collaborative Decision Making feature enabled on your site, you can decide to create a table to store data from the voting questions used in your forms.

<Info>
  The AppInstanceId, Server, Database, SQL user name, and Password fields are all required. If any are left blank, the following pop-up is displayed:

  <img src="https://mintcdn.com/flowforma/46u--5D7TPNcEo4x/images/product/flowforma-reporting/flowforma-reporting-exporting-form-data-to-sql-database/flowforma-reporting-exporting-form-data-to-sql-database-4.png?fit=max&auto=format&n=46u--5D7TPNcEo4x&q=85&s=782a1a3f4e10a774639cbfdf3abe3c28" alt="Required fields warning pop-up" width="439" height="118" data-path="images/product/flowforma-reporting/flowforma-reporting-exporting-form-data-to-sql-database/flowforma-reporting-exporting-form-data-to-sql-database-4.png" />
</Info>

<Info>
  If any of the fields entered are invalid, the following pop-up is displayed:

  <img src="https://mintcdn.com/flowforma/46u--5D7TPNcEo4x/images/product/flowforma-reporting/flowforma-reporting-exporting-form-data-to-sql-database/flowforma-reporting-exporting-form-data-to-sql-database-5.png?fit=max&auto=format&n=46u--5D7TPNcEo4x&q=85&s=ac70186933eb4e012ce25fbcbe7e4f39" alt="Invalid fields warning pop-up" width="435" height="118" data-path="images/product/flowforma-reporting/flowforma-reporting-exporting-form-data-to-sql-database/flowforma-reporting-exporting-form-data-to-sql-database-5.png" />
</Info>

<img src="https://mintcdn.com/flowforma/46u--5D7TPNcEo4x/images/product/flowforma-reporting/flowforma-reporting-exporting-form-data-to-sql-database/flowforma-reporting-exporting-form-data-to-sql-database-6.png?fit=max&auto=format&n=46u--5D7TPNcEo4x&q=85&s=225349a83729663ca05eea5ea0e6742f" alt="SQL connection form fields" width="671" height="363" data-path="images/product/flowforma-reporting/flowforma-reporting-exporting-form-data-to-sql-database/flowforma-reporting-exporting-form-data-to-sql-database-6.png" />

If any of the fields are blank, you'll see the first pop-up above; if any of the fields are invalid, you'll see the second pop-up above.

If all the fields are entered correctly, you'll see the following pop-up:

<img src="https://mintcdn.com/flowforma/46u--5D7TPNcEo4x/images/product/flowforma-reporting/flowforma-reporting-exporting-form-data-to-sql-database/flowforma-reporting-exporting-form-data-to-sql-database-7.png?fit=max&auto=format&n=46u--5D7TPNcEo4x&q=85&s=faf952b6d821eb9b74f4785c581e675c" alt="Connection successful pop-up" width="430" height="113" data-path="images/product/flowforma-reporting/flowforma-reporting-exporting-form-data-to-sql-database/flowforma-reporting-exporting-form-data-to-sql-database-7.png" />

Click **OK** in the pop-up.

If you don't want to create the connection to the SQL database, click **Cancel**. The connection won't be saved.

If you want to save the connection, click **Save**.

<img src="https://mintcdn.com/flowforma/46u--5D7TPNcEo4x/images/product/flowforma-reporting/flowforma-reporting-exporting-form-data-to-sql-database/flowforma-reporting-exporting-form-data-to-sql-database-8.png?fit=max&auto=format&n=46u--5D7TPNcEo4x&q=85&s=bb4242836f29de4912951d245cb0cfe6" alt="Saved SQL connection displayed" width="674" height="145" data-path="images/product/flowforma-reporting/flowforma-reporting-exporting-form-data-to-sql-database/flowforma-reporting-exporting-form-data-to-sql-database-8.png" />

The connection is now displayed.

If you want to edit the connection, click **Edit**. The connection screen is displayed with the existing connection details.

<img src="https://mintcdn.com/flowforma/46u--5D7TPNcEo4x/images/product/flowforma-reporting/flowforma-reporting-exporting-form-data-to-sql-database/flowforma-reporting-exporting-form-data-to-sql-database-6.png?fit=max&auto=format&n=46u--5D7TPNcEo4x&q=85&s=225349a83729663ca05eea5ea0e6742f" alt="Edit connection screen with existing details" width="671" height="363" data-path="images/product/flowforma-reporting/flowforma-reporting-exporting-form-data-to-sql-database/flowforma-reporting-exporting-form-data-to-sql-database-6.png" />

If you want to remove the connection, click **Remove**.

The connection is no longer displayed.

<img src="https://mintcdn.com/flowforma/46u--5D7TPNcEo4x/images/product/flowforma-reporting/flowforma-reporting-exporting-form-data-to-sql-database/flowforma-reporting-exporting-form-data-to-sql-database-9.png?fit=max&auto=format&n=46u--5D7TPNcEo4x&q=85&s=eff486199f8e2c5b37eb33d5418a609a" alt="Connection list after removal" width="679" height="87" data-path="images/product/flowforma-reporting/flowforma-reporting-exporting-form-data-to-sql-database/flowforma-reporting-exporting-form-data-to-sql-database-9.png" />

## Tables created in the SQL database

When you create a connection, the following tables are added to the database you selected.

### dbo.Forms

<img src="https://mintcdn.com/flowforma/46u--5D7TPNcEo4x/images/product/flowforma-reporting/flowforma-reporting-exporting-form-data-to-sql-database/flowforma-reporting-exporting-form-data-to-sql-database-10.png?fit=max&auto=format&n=46u--5D7TPNcEo4x&q=85&s=4c5b6ca905660e88ea6c39e35c9075e2" alt="dbo.Forms table columns" width="210" height="297" data-path="images/product/flowforma-reporting/flowforma-reporting-exporting-form-data-to-sql-database/flowforma-reporting-exporting-form-data-to-sql-database-10.png" />

**FormID**: The unique Form Id

**FlowID**: The Id of the flow used to create the form

**FlowTitle**: The title of the flow used to create the form

**Title**: The form title, a combination of the form prefix and unique form Id

**Status**: The current status of the form, the current open step in the form, or completed

**Completed**: Yes/No

**EstimatedCompleteDate**: The estimated time to complete a form as defined in the flow settings.

**Overdue**: Yes / No

**CurrentStepId**: The id of the step that the form is currently at

**Modified**: The date and time the form was last modified, step saved or submitted

**InternalID**:

**AppInstanceID**: The connection name for the app where the form was created.

#### Table relationships

|    | **Column**    | **Relationship table**  | **Column**    |
| -- | ------------- | ----------------------- | ------------- |
| 1  | FlowID        | Flows                   | FlowID        |
| 2  | AppInstanceID | Flows                   | AppInstanceID |
| 3  | FormID        | Steps                   | FormID        |
| 4  | AppInstanceID | Steps                   | AppInstanceID |
| 5  | FormID        | Questions               | FormID        |
| 6  | AppInstanceID | Questions               | AppInstanceID |
| 7  | FormID        | RepeatingTableQuestions | FormID        |
| 8  | AppInstanceID | RepeatingTableQuestions | AppInstanceID |
| 9  | FormID        | Auditing                | FormID        |
| 10 | AppInstanceID | Auditing                | AppInstanceID |
| 11 | FormID        | Voting                  | FormID        |
| 12 | AppInstanceID | Voting                  | AppInstanceID |

### dbo.Flows

<img src="https://mintcdn.com/flowforma/46u--5D7TPNcEo4x/images/product/flowforma-reporting/flowforma-reporting-exporting-form-data-to-sql-database/flowforma-reporting-exporting-form-data-to-sql-database-11.png?fit=max&auto=format&n=46u--5D7TPNcEo4x&q=85&s=ff064c9fbe4f80775189003f950ba761" alt="dbo.Flows table columns" width="169" height="125" data-path="images/product/flowforma-reporting/flowforma-reporting-exporting-form-data-to-sql-database/flowforma-reporting-exporting-form-data-to-sql-database-11.png" />

**FlowID**: The unique Id for the Flow

**Title**: The title of the flow

**AppInstanceID**: The connection name for the app where the flow was created.

#### Table relationships

| **Column**    | **Relationship table** | **Column**    |
| ------------- | ---------------------- | ------------- |
| FlowID        | Forms                  | FlowID        |
| AppInstanceID | Forms                  | AppInstanceID |

### dbo.Steps

<img src="https://mintcdn.com/flowforma/46u--5D7TPNcEo4x/images/product/flowforma-reporting/flowforma-reporting-exporting-form-data-to-sql-database/flowforma-reporting-exporting-form-data-to-sql-database-12.png?fit=max&auto=format&n=46u--5D7TPNcEo4x&q=85&s=d8884a56f2e2bae207fcd3e504616949" alt="dbo.Steps table columns" width="207" height="299" data-path="images/product/flowforma-reporting/flowforma-reporting-exporting-form-data-to-sql-database/flowforma-reporting-exporting-form-data-to-sql-database-12.png" />

**UniqueID**: the Unique ID, a combination of the form Id and the step Id

**StepID**: the unique step Id from the steps list

**FormID**: the unique Id of the form where the step was used

**Title**: the title of the step

**Started**: the date and time the first step in the flow was saved / submitted

**Description**: any description that has been added in the step definition to be displayed on the form

**Comments**: any comments that have been added into the comments field at the foot of the step

**Visible**: is the step hidden or visible

**Completed**: has the step been completed, submitted

**EstimatedCompleteDate**: the estimated time to complete the step set in the step definition

**Overdue**: was the step completed within the estimated time to complete

**AssignTo**: Who is / was the step assigned to

**Modified**: The date and time the form was last modified, step saved or submitted

**AppInstanceID**: The connection name for the app where the flow was created.

#### Table relationships

| **Column**    | **Relationship table** | **Column**    |
| ------------- | ---------------------- | ------------- |
| FlowID        | Forms                  | FlowID        |
| AppInstanceID | Forms                  | AppInstanceID |
| UniqueID      | Steps                  | StepUniqueID  |
| AppInstanceID | Steps                  | AppInstanceID |

### dbo.Questions

<img src="https://mintcdn.com/flowforma/46u--5D7TPNcEo4x/images/product/flowforma-reporting/flowforma-reporting-exporting-form-data-to-sql-database/flowforma-reporting-exporting-form-data-to-sql-database-13.png?fit=max&auto=format&n=46u--5D7TPNcEo4x&q=85&s=4df6e5d872ce4748d75a792aa910eff8" alt="dbo.Questions table columns" width="193" height="354" data-path="images/product/flowforma-reporting/flowforma-reporting-exporting-form-data-to-sql-database/flowforma-reporting-exporting-form-data-to-sql-database-13.png" />

**UniqueID**: The Unique ID, a combination of the form Id, step Id and the question Id

**StepUniqueID**: The unique step id, a combination of the form id and step id where the question has been added

**FormID**: the unique Id of the form where the step / question was used

**StepID**: the unique step Id from the steps list

**QuestionID**: the unique question id from the questions list

**Title**: the title of the question

**Code**: the unique internal question code, by default a combination of a system generated step code and question code

**Answer**: the answer that has been entered into the question

**AnswerFullValue**:

**Description**: any description that has been added in the question definition to be displayed on the form as a tooltip

**Visible**: is the step hidden or visible

**Enabled**: is the question enabled or disabled

**Type**: the question type

**Question Type**: the question type

**ParentQuestionID**: Used when the question is a repeating table, as the question is the parent of the repeating table's sub questions

**Modified**: The date and time the form was last modified, step saved or submitted

**AppInstanceID**: The connection name for the app where the flow was created.

#### Table relationships

| **Column**    | **Relationship table**  | **Column**       |
| ------------- | ----------------------- | ---------------- |
| FlowID        | Forms                   | FlowID           |
| AppInstanceID | Forms                   | AppInstanceID    |
| StepUniqueID  | Steps                   | UniqueID         |
| AppInstanceID | Steps                   | AppInstanceID    |
| UniqueID      | RepeatingTableQuestions | ParentQuestionID |

### dbo.RepeatingTableQuestions

<img src="https://mintcdn.com/flowforma/46u--5D7TPNcEo4x/images/product/flowforma-reporting/flowforma-reporting-exporting-form-data-to-sql-database/flowforma-reporting-exporting-form-data-to-sql-database-14.png?fit=max&auto=format&n=46u--5D7TPNcEo4x&q=85&s=cbd457d95776b353a22195236e56d650" alt="dbo.RepeatingTableQuestions table columns" width="227" height="759" data-path="images/product/flowforma-reporting/flowforma-reporting-exporting-form-data-to-sql-database/flowforma-reporting-exporting-form-data-to-sql-database-14.png" />

**UniqueID**: the Unique ID, a combination of the form Id, step Id, question Id and repeating table row number

**FormID**: the unique Id of the form where the step / question was used

**StepID**: the unique step Id from the steps list

**Row Index**: the reference to the row in the repeating table

**RepeatingTableRowEntityId**: The Unique ID, a combination of the form Id, step Id, question Id and repeating table row number

**RepeatingTableEntity**: a combination of the Form Id, step Id and parent question id

**ParentQuestionID**: the id of the [Repeating table question](/product/creating-flows/questions/question-types/repeating-table-question) that contains all the sub questions.

**Answer**: a concatenation of the answers to all the sub questions in the repeating table.

**AnswerFullValue**:

**Column0**: The answer of the sub question in the first column of the repeating table for this row in the repeating table

This repeats up to Column20<br />
**StepUniqueID**: A combination of the FormId and StepId that contains the repeating table question

**Title**:

**Code**:

**Description**: any description that has been added in the question definition to be displayed on the form as a tooltip

**Visible**: is the step hidden or visible

**Enabled**: is the question enabled or disabled

**Type**: the question type

**Question Type**: the question type

**Modified**: The date and time the form was last modified, step saved or submitted

**AppInstanceID**: The connection name for the app where the flow was created.

If you have selected to include audit data, an audit table will be added.

#### Table relationships

| **Column**       | **Relationship table** | **Column**    |
| ---------------- | ---------------------- | ------------- |
| FormID           | Forms                  | FormID        |
| AppInstanceID    | Forms                  | AppInstanceID |
| ParentQuestionID | Questions              | UniqueID      |
| AppInstanceID    | Questions              | AppInstanceID |

### dbo.Auditing

<img src="https://mintcdn.com/flowforma/46u--5D7TPNcEo4x/images/product/flowforma-reporting/flowforma-reporting-exporting-form-data-to-sql-database/flowforma-reporting-exporting-form-data-to-sql-database-15.png?fit=max&auto=format&n=46u--5D7TPNcEo4x&q=85&s=d8ba07c88a5f913ad86a2f563800c98e" alt="dbo.Auditing table columns" width="162" height="235" data-path="images/product/flowforma-reporting/flowforma-reporting-exporting-form-data-to-sql-database/flowforma-reporting-exporting-form-data-to-sql-database-15.png" />

If you have selected to include voting data, a voting table will be added.

#### Table relationships

| **Column**    | **Relationship table** | **Column**    |
| ------------- | ---------------------- | ------------- |
| FormID        | Forms                  | FormID        |
| AppInstanceID | Forms                  | AppInstanceID |

### dbo.Voting

<img src="https://mintcdn.com/flowforma/46u--5D7TPNcEo4x/images/product/flowforma-reporting/flowforma-reporting-exporting-form-data-to-sql-database/flowforma-reporting-exporting-form-data-to-sql-database-16.png?fit=max&auto=format&n=46u--5D7TPNcEo4x&q=85&s=80a86e7510f993b1f6d60d5610f0f24c" alt="dbo.Voting table columns" width="209" height="295" data-path="images/product/flowforma-reporting/flowforma-reporting-exporting-form-data-to-sql-database/flowforma-reporting-exporting-form-data-to-sql-database-16.png" />

#### Table relationships

| **Column**    | **Relationship table** | **Column**    |
| ------------- | ---------------------- | ------------- |
| FormID        | Forms                  | FormID        |
| AppInstanceID | Forms                  | AppInstanceID |

## Form data extract

### First time connection

When you first add a connection and the update procedure runs, all form data from the site will be copied to the SQL tables.

<Info>
  Audit and Voting tables will only be updated if they are included in the connection settings
</Info>

### Subsequent connection

The OData update then runs every hour, and the SQL tables are updated to reflect any changes that have been made to the form data (forms, flows, steps, questions, repeating table questions, auditing, voting).

### Removing the connection

If you remove the connection, all data updated to this point is retained but no further updates will take place.
