By default, your Afterpattern apps do not save data. If you want to save the data your app collects, including documents and analytics information (how often people use your app), you must send it to a database.
When you attach a send data function to a page block, your app will send data the moment that page is run.
You can attach a send data function to almost any page block, but the best practice is to use a background page:
You can send data to four different end points:
Depending on which end point you select, you'll have to make a few more choices before moving onto part two, specifying what data you want to send. For example, if you send data to "Database", you'll have to choose which table to send data to.
After you add a send data function to a page block, you must specify exactly data you want to send. To do that, click "Edit webhook" (the send data function is technically known as a webhook):
After you click "Edit webhook", you can map data to your table columns. You add columns one at a time, and for each column you specify what data to send:
When you specify what data to send to a column, you can either select a variable from your app or write in a value:
You can auto send variable to matching columns, but what is a "matching column"? This requires careful planning when building your app. Learn more.
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.
If you app includes a loop (also known as repeating questions), you can send that data to a database so that each loop member creates a new record (a row) in your database. Learn how.
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: