Skip to content
How-toForDeveloper⏱ About 20 min
Before you start:
  • Build access in an organization

Tutorial: an equipment checkout app ​

A store lends tools and equipment to staff and wants to see what's out and what's overdue. You'll build it in about 20 minutes.

1. The table ​

  1. App Builder → Registered tables → New table.

  2. Code equipment_checkout, Label "Equipment checkout".

  3. Columns (Add column for each):

    nametypelabel
    itemstringItem
    borrowerstringBorrower
    checked_outdateChecked out
    due_backdateDue back
    returnedboolReturned
    notestextNotes
  4. Create table. Note its database name, app_t<organization id>_equipment_checkout: you'll need it for the query.

2. The page ​

  1. App views → New view: Code equipment (the page will be at /app/equipment), Title "Equipment checkout", Type "Page (visual builder)", Primary table "Equipment checkout".
  2. Leave Publish to nav (creates menu item + grants tenant) ticked, and click Create view. The Page designer opens.
  3. Click Templates, set Bind data widgets to table to "Equipment checkout", and apply List + form (a grid on the left, a form on the right).
  4. Click Save page, then Preview.

Enter dates as YYYY-MM-DD.

3. A query for overdue items ​

  1. Queries → New query: Title "Overdue equipment", Code overdue_equipment, Type SQL SELECT, Connection "App tables (this organization)".

  2. SQL:

    sql
    SELECT item, borrower, due_back
    FROM app_t<organization id>_equipment_checkout
    WHERE returned = 0 AND due_back < CURRENT_DATE
    ORDER BY due_back
  3. Turn on Usable from app pages and Save. Run shows the result.

  4. Back in the page designer, add a Data grid, and in Properties pick Named query "Overdue equipment". Save page.

4. Who sees it ​

The view's menu item is now in the organization's menu. In Modules & Access, tick the groups that should see "Equipment checkout" (see Modules and menus). They open it from the navigation, or at /app/equipment.

Who can save rows

As built, people with build access can add and change rows; everyone else who sees the page can read it. To let a group check equipment out, give the view row permissions (config.access) through the API or a package, and grant those permissions to the group.

Next ​

  • Pin it to the dashboard: Customize → + Builder app, App code equipment.
  • Add a workflow that emails a reminder through your mail service's HTTP API: reference.
  • Read it from another system: Tenant API.