If you want to save data collected by your app, you must send it to a database. You can send all manner of data from an app to a database, including documents and analytics information (data regarding how often people use your app).
Sending data from your app is a relatively simple two-step process:
You send data from a Page Block using the 'Send Data' function:
When you add a 'Send Data' function, you must select where you want to send the data to. When you select 'Workbase', you'll be prompted to select which Workbase (you can have multiple) and which table within that Workbase.
You decide exactly what data is sent to your database. When you click "+ Add", you can specify what column in your database you want to populate and what data you want to populate it with:
When you select what data you want to populate in the database column, you can either select a variable or type a value in directly.
Remember, the left-most column in your database is the "key column." The value stored in this column must be unique for each row.
By default, when you send data from your app you are automatically assigning a random but unique value (a 32 character string):
You can choose anything to be your key column, just make sure that it's unique per user.
Whether your 'Send Data' function creates a new row or updates an existing row depends entirely on the value sent to the key column.
If you send data to a database and the key column value you send is equal to an existing key column value, the app will not create a new database record but instead will update that pre-existing record.
You can add a 'Send Data' function within a Loop Section, which means every time the end-user repeats over the loop the app will add another row of data to your database.
There are two challenges when sending data from within a loop:
This is an issue because you can only send data that has been defined in prior Page Blocks (you can't send data from the same Page Block where it is being defined). This means you need to add a Page Block to your loop whose sole purpose is sending data collected in prior loop Page Blocks, like this:
You want the key value param to be unique for each loop member, otherwise every time the end-user repeats the loop they will re-write their own data. This means that your key value must be a variable defined within your loop (anything else will not be unique across loop members).
If your app's variables have the exact same name as a columns in your database, then the variables are "matching" and you can use this feature.
These variables match the database columns: