> ## 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.

# Entity Data Management

> Connect FlowForma to a Microsoft SQL database and create entities to store form data with create, update, get, and delete operations, without stored procedures.

Entity Data Management is a feature in FlowForma that allows you to connect to a Microsoft SQL database and create entities to store FlowForma form data. Using Entity Data Management, you can send and receive data between forms and a SQL database without creating SQL stored procedures or relying on the [Execute SQL stored procedure](/product/creating-flows/business-rules/business-rule-types/data-integration-rules/execute-sql-stored-procedure) rule.

It supports create, update, get, and delete operations.

## Creating a connection

Access [FlowForma settings](/product/flowforma-settings/overview), click **[Global Connections](/product/flowforma-settings/global-connections)**, and scroll to the EDM connections section.

<img src="https://mintcdn.com/flowforma/v8UMuZxCjEz54jQV/images/product/entity-data-management/entity-data-management-1.png?fit=max&auto=format&n=v8UMuZxCjEz54jQV&q=85&s=6191cd82053b4a643a3ee9e75d0e0199" alt="EDM connections section in Global Connections" width="1626" height="201" data-path="images/product/entity-data-management/entity-data-management-1.png" />

You will need to enter the following details to create a connection:

**Server**: the server where the database is hosted
**Database**: the name of the database where the FlowForma entities will be created
**SQL user name**: the name of an SQL user with owner access to the database, since tables and relationships are created during the setup process
**Password**: the password for the SQL user above

### Database components

When the database is created, whether a FlowForma database or a custom database, the following items are added:

* Database table dbo.Sys\_Flows
* Database table dbo.Sys\_Forms
* Relationship between dbo.Sys\_Forms and dbo.Sys\_Flows

dbo.Sys\_Flows

This table contains details of the FlowForma flow that was used to generate forms that use the entity data management database.

<img src="https://mintcdn.com/flowforma/v8UMuZxCjEz54jQV/images/product/entity-data-management/entity-data-management-2.png?fit=max&auto=format&n=v8UMuZxCjEz54jQV&q=85&s=7874e0db29f39778c4507b5ffb2e18bf" alt="dbo.Sys_Flows table columns" width="240" height="165" data-path="images/product/entity-data-management/entity-data-management-2.png" />

**ID**: a sequential number starting at 1. The first time a flow uses the database, a new record is added to the entity and the next sequential number is used.
**SubscriptionID**: the subscription for the FlowForma instance being used
**Title**: the title of the flow
**AppUrl**: the URL of your FlowForma site where the forms are being generated

dbo.Sys\_Forms

<img src="https://mintcdn.com/flowforma/v8UMuZxCjEz54jQV/images/product/entity-data-management/entity-data-management-3.png?fit=max&auto=format&n=v8UMuZxCjEz54jQV&q=85&s=b2c146bd7f052bc7a33f14264da94758" alt="dbo.Sys_Forms table columns" width="245" height="142" data-path="images/product/entity-data-management/entity-data-management-3.png" />

When forms are created, the entity is updated as follows:

**ID**: a sequential number starting at 1. Each time a form that uses the entity data manager is created, an item is added to this entity and the next number in the sequence is used. In effect, this is the entity form ID.
**FlowID**: the unique ID of the FlowForma flow that was used to generate the form
**FlowFormaFormID**: the unique ID of the FlowForma form created; this is used in the FlowForma site
**Title**: the title of the form created, a combination of the form prefix (set in the flow definition, defaulting to Form) and the unique form FlowFormaFormID

### Relationship

A relationship between the two entities is also created:

Sys\_Forms.FlowID to Sys\_Flows.ID

### Creating entity

Once you have connected to your database, the Entity Data Manager is enabled in the FlowForma Flow Designer.

Open the Flow Designer. You will now see the Entity Manager icon on the flow-level toolbar.

<img src="https://mintcdn.com/flowforma/v8UMuZxCjEz54jQV/images/product/entity-data-management/entity-data-management-4.png?fit=max&auto=format&n=v8UMuZxCjEz54jQV&q=85&s=4562e524dec2e17f8c8f31a01da87df6" alt="Entity Manager icon on the Flow level toolbar" width="723" height="746" data-path="images/product/entity-data-management/entity-data-management-4.png" />

You will now see the Entity Data Manager panel. The panel defaults to "Add entity", but there are also options to update an entity and delete an entity.

<img src="https://mintcdn.com/flowforma/v8UMuZxCjEz54jQV/images/product/entity-data-management/entity-data-management-5.png?fit=max&auto=format&n=v8UMuZxCjEz54jQV&q=85&s=0257c04c9080471d0ed3a98c5cccac05" alt="Entity Data Manager panel" width="603" height="523" data-path="images/product/entity-data-management/entity-data-management-5.png" />

**Entity Name**: enter a unique entity name; it cannot include spaces, and this will be the name used when the entity is created in the database
**Entity fields**: displays all the steps in the flow with all the questions contained on those steps

The first step is expanded by default. To see the questions on other steps, click the + sign next to the step name to expand it.
Select the questions you want included in your entity by checking the checkbox next to the question.

### Supported question types and database properties

The following FlowForma question types are currently supported by the Entity Data Manager, along with the database datatype used for each.

| **FlowForma question type** | **SQL datatype** |
| --------------------------- | ---------------- |
| Single line of text         | nvarchar(MAX)    |
| Calculated                  | nvarchar(MAX)    |
| Choice                      | nvarchar(MAX)    |
| Date and time               | datetime         |
| File upload                 | nvarchar(MAX)    |
| Lookup                      | nvarchar(MAX)    |
| Multiple lines of text      | nvarchar(MAX)    |
| Number                      | Float            |
| Person or Group             | nvarchar(MAX)    |
| Yes No                      | bit              |

<Warning>
  Fields added to the entity must have unique names, so questions you want included in the entity must have unique names.
</Warning>

<Info>
  Any supported question in the flow can be included in an entity. You can also create a number of different entities from one flow.
</Info>

Enter a name in the **Entity Name** field.

Select all the questions you want to include in the entity.

<img src="https://mintcdn.com/flowforma/v8UMuZxCjEz54jQV/images/product/entity-data-management/entity-data-management-6.png?fit=max&auto=format&n=v8UMuZxCjEz54jQV&q=85&s=15efb5343505a3c00fa644f6e71e660a" alt="Selecting questions to include in the entity" width="619" height="550" data-path="images/product/entity-data-management/entity-data-management-6.png" />

When you have selected all the questions you want to include in your entity, click Save. If the entity is created successfully, you will see the pop-up below.

<img src="https://mintcdn.com/flowforma/v8UMuZxCjEz54jQV/images/product/entity-data-management/entity-data-management-7.png?fit=max&auto=format&n=v8UMuZxCjEz54jQV&q=85&s=29ad0d09b6301470400f98f57287e45b" alt="Entity created successfully pop-up" width="452" height="128" data-path="images/product/entity-data-management/entity-data-management-7.png" />

Your entity has now been created. The following entities have been created in the database:

* dbo.Entity\_**EntityName** (the entity name being the Entity Name you have just entered, in the example above this was Customers)

<img src="https://mintcdn.com/flowforma/v8UMuZxCjEz54jQV/images/product/entity-data-management/entity-data-management-8.png?fit=max&auto=format&n=v8UMuZxCjEz54jQV&q=85&s=cc7133dbc2328187d5870ea1c8bdab3d" alt="dbo.Entity_Customers table columns" width="295" height="214" data-path="images/product/entity-data-management/entity-data-management-8.png" />

This entity contains a column for a unique entity ID and columns for all the questions selected above.

* dbo.FormEntity\_**EntityName** (the entity name being the Entity Name you have just entered, in the example above this was Customers)

<img src="https://mintcdn.com/flowforma/v8UMuZxCjEz54jQV/images/product/entity-data-management/entity-data-management-9.png?fit=max&auto=format&n=v8UMuZxCjEz54jQV&q=85&s=69a0d9ddd856dd22f810d5d40d4bf52c" alt="dbo.FormEntity_Customers table columns" width="337" height="213" data-path="images/product/entity-data-management/entity-data-management-9.png" />

This entity has relationships to both the Entity\_EntityName and dbo.Sys\_Forms entities, as well as columns that retain details of form creation and modification.

### Business rule

For convenience, a step-completed **[Execute EDM operations](/product/creating-flows/business-rules/business-rule-types/feature-pack-business-rules/execute-edm-operations) - Create new entity item** business rule is added to the last step of the flow that contains questions included in the entity.

<img src="https://mintcdn.com/flowforma/v8UMuZxCjEz54jQV/images/product/entity-data-management/entity-data-management-10.png?fit=max&auto=format&n=v8UMuZxCjEz54jQV&q=85&s=0c1a4900b76e479fc9e68dac1d9bcb11" alt="Execute EDM operations business rule" width="619" height="729" data-path="images/product/entity-data-management/entity-data-management-10.png" />

All the items selected when you created the entity are included, with flow questions mapped to the database entity fields.

This rule may not meet your business requirements. If not, you can edit, remove, or disable it as required.

<Info>
  For more information on the Execute EDM operations business rule see Execute EDM operations in the business rules section
</Info>

Now, when a form is created and the step containing the business rule is submitted, the database entities are updated as defined in the rule.

## Update entity

Update entity allows you to add and/or remove questions from an existing entity.

Open the Entity Data Manager from within FlowForma Settings. By default, the editor opens in Add entity mode; select Update entity.

The editor now displays a drop-down that contains all the entities present in the database.

<img src="https://mintcdn.com/flowforma/v8UMuZxCjEz54jQV/images/product/entity-data-management/entity-data-management-11.png?fit=max&auto=format&n=v8UMuZxCjEz54jQV&q=85&s=3cde5fabb1ed01378c5c8966634e06d1" alt="Update entity drop-down listing existing entities" width="615" height="449" data-path="images/product/entity-data-management/entity-data-management-11.png" />

Select the entity that you require.

The Fields section displays all the form questions currently included in the entity, each with a checked checkbox next to it.

The Add field section lists all questions contained in the current flow.

### Add an item

To add an item that isn't included, check the checkbox next to the question you want added. It will now be added to the entity, and a new column will be added to the table in the database.

### Remove an item

To remove an item from the entity, uncheck the checkbox next to a question included in the entity. The column in the database relating to this item is retained, but no further items will be added to it.

Using the Customers entity as an example, the entity before any changes is as below.

<img src="https://mintcdn.com/flowforma/v8UMuZxCjEz54jQV/images/product/entity-data-management/entity-data-management-12.png?fit=max&auto=format&n=v8UMuZxCjEz54jQV&q=85&s=cba29edddd3cf23357924436352c69ff" alt="dbo.Entity_Customers before changes" width="297" height="213" data-path="images/product/entity-data-management/entity-data-management-12.png" />

Open the Entity Data Manager and add or remove questions as required.

<img src="https://mintcdn.com/flowforma/v8UMuZxCjEz54jQV/images/product/entity-data-management/entity-data-management-13.png?fit=max&auto=format&n=v8UMuZxCjEz54jQV&q=85&s=2d3a05dd6dd4bf39f7431de0cc0afb18" alt="Editing entity fields in the Entity Data Manager" width="619" height="692" data-path="images/product/entity-data-management/entity-data-management-13.png" />

In this case, the questions 'Address line 2' and 'Contact name' have been removed, and 'Credit limit' and 'Added to accounts receivable' have been added:

Click Save to confirm the changes. The following pop-up is displayed to confirm the changes.

<img src="https://mintcdn.com/flowforma/v8UMuZxCjEz54jQV/images/product/entity-data-management/entity-data-management-14.png?fit=max&auto=format&n=v8UMuZxCjEz54jQV&q=85&s=8840aa99cd4deb50a2c168a2597422c0" alt="Entity update confirmation pop-up" width="448" height="130" data-path="images/product/entity-data-management/entity-data-management-14.png" />

In the database, the entity dbo.Entity\_Customers is now as below.

\[Credit Limit] and \[Added to accounts receivable] have been added to the database. 'Address line 2' and 'Contact name' are still in the entity, but no further updates will be possible.

<img src="https://mintcdn.com/flowforma/v8UMuZxCjEz54jQV/images/product/entity-data-management/entity-data-management-15.png?fit=max&auto=format&n=v8UMuZxCjEz54jQV&q=85&s=09ef57aa14b1bfb777c927decdccc375" alt="dbo.Entity_Customers after changes" width="298" height="261" data-path="images/product/entity-data-management/entity-data-management-15.png" />

## Delete entity

Enter the Entity Data Manager from the FlowForma settings panel.

When the editor opens, select Delete entity.

<img src="https://mintcdn.com/flowforma/v8UMuZxCjEz54jQV/images/product/entity-data-management/entity-data-management-16.png?fit=max&auto=format&n=v8UMuZxCjEz54jQV&q=85&s=267e1f2280e4d582274bbc3928d247e5" alt="Delete entity option in the Entity Data Manager" width="616" height="446" data-path="images/product/entity-data-management/entity-data-management-16.png" />

Select the entity you wish to delete from the drop-down, then click the Delete button at the bottom of the screen.

The pop-up below is displayed to warn that deleted entities cannot be restored. If you wish to continue and delete the entity, click OK.

<img src="https://mintcdn.com/flowforma/v8UMuZxCjEz54jQV/images/product/entity-data-management/entity-data-management-17.png?fit=max&auto=format&n=v8UMuZxCjEz54jQV&q=85&s=064ea6f3519340425e8f2fa8a8dea237" alt="Delete entity warning pop-up" width="452" height="151" data-path="images/product/entity-data-management/entity-data-management-17.png" />

Another pop-up is displayed confirming the deletion.

<img src="https://mintcdn.com/flowforma/v8UMuZxCjEz54jQV/images/product/entity-data-management/entity-data-management-18.png?fit=max&auto=format&n=v8UMuZxCjEz54jQV&q=85&s=2c0dcff91c52a97172e7af7a10b64eb9" alt="Entity deletion confirmation pop-up" width="452" height="129" data-path="images/product/entity-data-management/entity-data-management-18.png" />

In the database, both the dbo.Entity\_EntityName and dbo.FormEntity\_EntityName entities are removed and will no longer be available.

<Warning>
  Care should be taken when selecting Delete entity: the database tables relating to that entity will be removed, and any data stored in those tables will be lost.
</Warning>
