hub.eb?material_id=154

Intro to Tables


Tables are used to hold 2 dimensional data. Just like database tables, they have columns with a data type. Rows can be added to the table that have one value for each of those columns.

Like fields, tables keep the data values they are holding for the whole form session.

Tables can be found in the Tables tab:

Steps


1

Create a new table in a form. 

Go to the Tables tab on the right-hand side of the Studio and click New table

2

Give your table a name, e.g. myTable.

Click Create new columns and add three columns. 

Drag your table onto your form.

3

Let's add some data to your table.

Create a new script called myData and add the following code to your script:

tables.myTable.insertRow();
tables.myTable.A.value="A1";
tables.myTable.B.value="B1";
tables.myTable.C.value="C1";
tables.myTable.insertRow();
tables.myTable.A.value="A2";
tables.myTable.B.value="B2";
tables.myTable.C.value="C2";
tables.myTable.insertRow();
tables.myTable.A.value="A3";
tables.myTable.B.value="B3";
tables.myTable.C.value="C3";

This code will add and populate three new rows in your table.

4

Attach your script to your table. 

Right-click on your table in the Outline view, and add the script to the Before Table event.

Run your form and you'll see your data appears in the table.

Related