A relational database table can be used as a cloud object store. Customers who choose this option typically do so to capture images via the app and keep them along with the data in the same repository (convenient for backup and data management). The downside is that images stored within a relational database are not easy to access directly --- they can only be accessed via the app.
Each image or file is saved as a separate row in a database table. Instead of a table, you can use an updatable view. You need a
varchar(max) column which can hold the content (in base-64 encoded text format). You also need a column (at least
nvarchar(256)) to hold a unique text label that is used to identify and retrieve the image. AppSheet will only read and write these columns. Any other columns in the database table should therefore be nullable.
When you configure AppSheet, you will need to specify the database data source, the name of the table, and the names of the label column and the content column. If you expect this table to hold a large number of rows, it is a good idea to create a database index on the label column of this table.
Configure a relational database as a cloud object store as described in the following sections:
- Add a relational database as a data source
- Add the cloud object store to your AppSheet account
- Configure a table in an app to use the cloud object store
Read the existing documentation on adding data sources.
After you have your relational database configured, you are ready to add it to your AppSheet account
- Sign in to appsheet.com.
- Go to the My Account page.
- Click the Integrations tab.
- Click Stores in the left navigation.
- Perform one of the following steps:
- To add an object store for use by your own account, click New Cloud Store under Object Stores, then click DB-Content.
- To add an object store for your team member accounts, click New Cloud Store under Team Object Stores, then click DB-Content.
Note: You must be a Team Admin to create a team object store.
- Complete the Add DB-Content integration dialog to create the new object store. Enter the database name, select the database data source, and enter the names of the database table, label column, and content column.
- Click Save.
After you have added a cloud object store to your account, you can configure a table in an app to use it.
- Go to a table definition in the app editor on the Data > Tables page.
- In the properties, look for Cloud Object Store and enter the name of the object store that you set up for your account (such as, DBStore).
- Save the change.