Creating Tables

Is there a simple way to create tables? I have a SQL database with a large number of tables that I need staff to be able to add and update records. Or do I need to create a table view using columns and then a separate pages for adding and updating records.

Hello! Apologies for the late reply, the team took some time off to enter the new year full of energy :slight_smile:

Yes! The simplest way to create tables is to drag and drop the “Table” element in the “Add element” menu:

Then, inside a columns element, you could add one table and one form for each table you need users to be able to update. In the example below, we want to let users update the mileage of the vehicles that are listed in the table on the left:

When a user selects a line in the table, you could set a trigger to update a variable called Selected Line:

And bind each field of the form to the right info in the Selected Line variable:

Then, you’d create a workflow at form container level and refer to the record ID of the selected line:

Then you would update your database with the values provided by the user in the form, i.e. the variables associated with each form field:

Finally, you would fetch your collection again at the end of the workflow to ensure that the table on your WeWeb page reflects the latest changes made to the table in your database:

Does this help?

We’re planning to record a full video tutorial showing this use case in the coming days so if anything is unclear, please don’t hesitate to let us know! We’ll be more than happy to adjust the tutorial accordingly :slight_smile:

1 Like

Hello! :wave:

Thought you might enjoy these two tutorials :slight_smile:

  • how to add the table element in WeWeb and display data from your backend in it (tutorial here)

  • how to add a workflow that is pre-filled with the data from the selected line in the table and let’s users make updates to the backend that will dynamically appear in the frontend (tutorial here)

Let me know if there’s anything that’s unclear!