---
title: "Define table field"
id: "define-table-field"
project: "EHR User Guide"
url: "https://help.cloud5.com.au/articles/ehr-user-guide/define-table-field"
updated: 2026-10-19T00:53:45Z
---

# Define table field

When defining a form template field, selecting **e**(Table) as the **Data Type**allows you to enter SQL statements for EmpowerHR to run and then display the results in a table on the form. You can use SQL to return multiple rows and columns. EmpowerHR does not save the SQL results with the form, but runs the SQL each time the form is loaded. See  [SQL for self service forms](/smart/project-ehr-technical-user-guide/sql-for-self-service-forms) in the EHR Technical User Guide ![](/resources/Storage/ehr-user-guide/icons/info%20icon%20-%20small.png) for examples of SQL statements and tags.
If you don't have access to the EHR Technical User Guide, you can log an [iHelp request](https://infusion.fusion5.com/) and we will provide login credentials to you.

You also need to define the title and length for each field returned by the SQL.

To define the title and length for fields returned by SQL:![](/resources/Storage/ehr-user-guide/ehr-user-guide/icons/desktop%20icon.png)

1. Go to the **Form Fields Definition** screen.
2. Select the row containing the table field, and then click **Next Level**.
3. EmpowerHR displays the **Enquiry Data Type Form** summary screen.
4. Click **New**.
5. EmpowerHR displays the **Enquiry Data Type Form** details screen.
6. At:
    1. **Title**, enter a title for the table column to be displayed
    2. **Field Length**, enter the number of characters for the length of the field

| ![Information](/resources/Storage/ehr-user-guide/ehr-user-guide/Info.png) | The field sequence maps to the field position in the SQL statement. For example, field sequence 1 maps to the first field, field sequence 2 maps to the second field (and so on) in the SQL statement. |
| --- | --- |

![](/resources/Storage/ehr-user-guide/set-table-field/Enq%20Data%20Type%20Form%20detail.png)

1. Click **Save**.
2. Repeat this procedure, starting at step 4, until you have defined all the required fields.

![](/resources/Storage/ehr-user-guide/set-table-field/Enq%20Data%20Type%20Form%20summ.png)
[+] [Show example: display in self service](javascript:void%280%29)
 [-] [Hide example: display in self service](javascript:void%280%29)
 Here is an example of how EmpowerHR displays the table in self service.

![](/resources/Storage/ehr-user-guide/set-table-field/table%20example%20in%20ss.png)

| Next topic<br><br>[Attach workflow to a form template](/articles/ehr-user-guide/attach-workflow-to-a-form-template) |
| --- |

© 2023 Fusion5. All rights reserved.