Skip to main content
Module 8 of 12 · Client work and the client portal · Lesson 18 of 18

Give a published app a database and logins with Cloud

Create a Cloud app, choose which Records tables it may use, set who can read and write each one, and test the rules before going live.

8 minAdvancedFor: Agency owner or managerLast checked
Video tutorial coming soon

The written steps below are complete. The Video script tab shows exactly what the video will cover.

Cloud turns the project's Records tables into a small database for a website or app you publish from Web Design, with logins for its users. It is marked Beta and is for people comfortable with a little code. The rules you set here decide who can see the data, so test them before anything goes live.

By the end you can

  • Create a Cloud app and store its keys safely
  • Expose only the tables the app needs
  • Set and test access rules for each table
  • Connect the published page

Screens used

  • Project, Ops hub, Cloud

Before you start

  • At least one Records table in the project (see Keep structured lists in Records).
  • A site or app in Web Design that will use the data.

Steps

  1. 1

    Open Cloud

    On: Project, Cloud

    Open the project, then open the Ops hub and choose Cloud.

    You should see: "No Cloud apps yet", or a list of apps.

  2. 2

    Create an app

    On: Project, Cloud

    Press New app, type an App name and press Create.

    You should see: A window titled "Save your keys" with two keys.

  3. 3

    Store the keys

    On: Project, Cloud

    Copy both keys into your password manager yourself. They are shown once. The Anon key (safe in HTML) may appear in a web page. The Service key (server only) must never be put in a page, a chat or an email. Then press I've saved them.

    You should see: The app is listed. Open it.

  4. 4

    Choose the tables

    On: Project, Cloud

    Under Exposed tables tick the Records tables this app may use, and press Save tables. Leave every other table unticked.

    You should see: "Tables saved." A new table starts as denied for everything.

  5. 5

    Set who can do what

    On: Project, Cloud

    Under Access policies each table has four actions: select (read), insert, update and delete. Choose a level for each: denied, public, authenticated or owner. Authenticated means anyone signed in to your app. Owner means only the person who created the row. A public level on insert or update lets anyone on the internet write to the table, and is highlighted as a warning. Press Save policies.

    You should see: "Policies saved."

  6. 6

    Test as a user

    On: Project, Cloud

    Under Test as user choose a table, choose who to test as, such as anonymous (anon key), and press Run select. It runs a real read with your rules.

    You should see: The rows that person would see, or "Blocked".

  7. 7

    Connect the page

    On: Workbench

    Under Connect your app copy the code shown. In Web Design open the site, open the HEAD panel of the page and paste it there, then publish.

    You should see: The published page can read and write the tables, within your rules.

Tips

  • Test as anonymous first. If that test returns rows you did not mean to make public, tighten the policy before publishing.
  • Lost a key? Rotate anon or Rotate service makes a new one. The old key stops working at once, so update the page straight away.
  • Keep personal data out of any table that anonymous visitors can read.

Troubleshooting

"No Records tables in this project yet."
Create a table in Records first, then come back to choose it.
The page shows no data and the test says Blocked.
The table is still denied for that action, or it was never ticked under Exposed tables. Tick it, set the policy and save both.
"The service key cannot be used from a browser. Use the anon key."
The page has the wrong key in it. Replace it with the anon key, then rotate the service key because it has been exposed.
"Daily write limit reached for this app"
The app has written its limit of rows for today. It works again tomorrow; check that nothing is writing in a loop.
Finished this lesson?

Mark it complete to keep your place in the course.