IT in Education

Storing data with the Tables app

nextcloudUsing the Tables app allows you to manage lists of data. It is easy to set up, and there are various types of fields. This article describes how to get started using Table.


Install the Tables app

Start by logging on with your admin account.

  1. Click your Avatar > Apps.
  2. Click the Download and enable button for the Tables app.

Create a new table

To get started you can simply click the Create a new table button.

  1. Title: Enter a meaningful name for this table.
  2. Description: Add some text so that other users know what this table is for.
  3. Select one of the templates or click Custom table.
  4. Click Create table button.

Columns

You now have an empty table, and you will need to create some fields (or Columns).

  1. Click the Create column button.
  2. Title: Enter a name for this column (e..g First name).
  3. Description: Add some text (e.g. This is the first name of the person).
  4. Type: Select from the dropdown. Depending on your selection, other options will appear.
    1. Text: Freeform text.
    2. Link: Save a URL.
    3. Number: Integers and decimal numbers.
    4. Stars Rating: Rating field.
    5. Progress Bar: Displays progress percentage as a line.
    6. Selection: Creates a dropdown field.
    7. Date and Time: Allows you to save a date and time.
  5. Mandatory: Toggle for whether this field is required.
  6. Click Save.

Views

Once you have a Table, you can create a view of your data.

  1. Click  > Create view, against your newly created table.
    1. Title: Give your view a meaningful name.
    2. Columns: Select the checkbox against the columns that you want to include in the view.
    3. Filter: Optionally filter your data so you only see a limited set.
    4. Sort: Put your data in order.
  2. Click the Create view button.

Rows

To start saving records, click the Create row link.

OCC Commands

There are some OCC Commands that you can run after accessing the root of your website using a Terminal.

To show a list of all Tables.

php occ tables:list

To clean the database... add the option -d to do a dry run without making changes.

php occ tables:clean -d

To transfer legacy rows to a new schema. This command is sometimes needed when upgrading the Tables app.

php occ tables:legacy:transfer:rows

To delete a table.

php occ tables:remove <ID>

 

Troubleshooting

Note that there appears to be an issue with the Tables app, recently when I upgraded to version 0.7.2, I found that the views to my data didn't load properly and it appeared as though all my records were missing. Here is the fix.

Access the root of the website, and run the following command:

php occ tables:legacy:transfer:rows --all


Thanks for visiting,
Steven