Data in base is stored in lists and data tables.
In this tutorial you will learn how to add, change or delete base data using an app.
For this app we will use an already existing list 'Countries_list' which contains data about different European countries ( You can copy it here).
Create a new app. Add two widgets: a spreadsheet and a table. Bind the table with 'Countries list'. Drag list fields to the table.
Hide 3 last columns by putting =false in visibility field. In spreadsheet delete all of the columns except one.
In first cell of the spreadsheet write 'Add, modify or delete data' and bold this text.
In all rows fill 'data field' field with names of 'Countries_list' fields :
country, capital, population, group.
Set cells as editable.
Bind the spreadsheet section with the table using lookup formula in 'Filter' field.
Next, bind spreadsheet cells with table columns by putting the equals sign and column name:
Change the A4 cell type (the one with population data) to 'Number'.
In cell options in 'data field' add list fields names the same way as you did in the table.
Add workflow actions widget. Go to workflow tab and add a new action there. It should begin and end in 'Start'. Name it 'Add or modify'.
Thanks to this action we will be able to add new rows to the list or modify them.
Every list contains unique values that defines a certain row - we call them keys. In our case 'Country' is a key. If we add a new country or modify an already existing country name we will automatically add a new list row. If we change any other field we will change information about the country.
Add 'save to database' actionstep. Put in the correct fields your spreadsheet name and list name.
Add one more action that begins and ends at the start. Name it 'delete' and add 'delete from database' actionstep to it. In options fill spreadsheet section name.
To both actions add 'refresh page' actionstep. It will cause the page to refresh after any data change.
3.Running the app
Add yourself as the app creator and save the app. Now run it and see how it works.
Now we will delete Norway from the list:
After clicking the button the page automatically refreshed. Now Norway is not on the list anymore.
Let's add Norway back. We need to put all of the country information manually. Now Norway is back on the list.