Data Pages & Queries
Put live data from your project's database on a real, designed page - a list of open service calls with the customer's name next to each one, a searchable customer directory, or a master-detail grid you can edit. You can do it all without writing SQL.
Which kind of data page do I use?
- Query - a read-only, searchable list that joins several related tables, e.g. service calls along with the customer's name and company. Best for directories, dashboards, and "what's open right now" lists.
- Data Grid - one main table plus its editable one-to-many children (a customer and their phone numbers, say), with search, filters, and infinite scroll.
- CRUD pages - a plain list/detail/edit page for each table. See CRUD Workspace.
All of these work in exported, self-hosted projects too - CRUD pages, Queries, Reports and Data Grids, including a grid's editing, bulk actions, saved views and CSV export. They show the same data to the site's owner and signed-in staff; visitors who aren't signed in see a sign-in message instead.
See how your tables relate: the Schema Canvas
Open CRUD Workspace → Generate / Regenerate to see every table in your database laid out as a diagram. Tables are arranged by how they reference each other: lookup tables sit on the left, the tables that depend on them sit to the right, and lines connect related tables. Each table lists its columns, with a key icon on the primary key and a link icon on the columns that point to another table.
Click a table to set its page title, URL slug, and the columns its list page shows. Check several tables and choose Generate CRUD Pages to create all their pages at once.
Build a page from fields across several tables
Check the tables you want on the canvas. The Composite page fields section in the side panel then lists every column of each checked table. Tick the fields you want, for example a contact's first and last name plus a service call's date, status, and problem summary, and choose Build Page from Selected Fields.
Nichols Software works out how those tables join from the relationships on the canvas and opens the Query Builder already filled in. All you have to do is review it and save. The tables you pick have to be related; if one isn't connected to the others, you'll see a message naming it.
The Query Builder
You can also build a query by hand or fine-tune one. The builder has these sections:
- Objects & joins - pick a root table, then join more tables onto it. A small diagram above the list shows the shape of your joins; click a box to jump to that table's settings.
- Fields to display - choose which columns appear, their order and labels, and whether each one is sortable or searchable. Check Group by on a field to turn the query into a summary (totals, counts, averages).
- Sort, Filters, a Date-range filter, and Having conditions for summaries.
- Row actions - buttons on each row (see below).
- Preview - the first 10 rows, so you can check the result before saving.
Every saved query gets its own page at /q/your-slug. Use the
Navigation section to also list it in your site's menu. To get back to a query
later, open CRUD Workspace and choose Edit next to it. The
builder's Schema Canvas button takes you back to the diagram.
Row actions
Row actions add buttons, such as View or Edit, to every row of a Query or Data Grid component on your pages. Each button opens a link. Pick a page under Link to page and the link fills itself in for the record on that row. Use Insert field to add any of the query's own fields to the link without learning the placeholder syntax. You can also type any URL, including one outside your site.
On a wide Query, the Actions column stays pinned to the right edge, so the buttons stay in view while you scroll sideways.
Putting a Query or Data Grid on a page
In the Page Builder, add the Query or Data Grid component from the component picker and choose a saved query or grid from its dropdown. The Edit and + New links next to the dropdown open the builder without leaving your page. On the published page, visitors can search (any field marked searchable), sort, and scroll; more rows load as they go.
Example: a Service Call Board
Here's how a plumbing company's office gets every service call on one page, alongside the customer who asked for it:
- On the Schema Canvas, check contacts and plumbing_service_calls. Under Composite page fields, pick the customer's first name, last name, and company, plus the service call's requested date, priority, status, service type, and problem summary.
- Choose Build Page from Selected Fields. The Query Builder opens with the two tables already joined on the customer, and the fields already set up and searchable.
-
Under Row actions, add an Open contact button that links to
/crm/contacts/{__pk}, so each row opens that customer in the CRM. Then save. - Create a page called Service Call Board, add the Query component, choose the new query, and publish. Leave Display on Navigation on (it's on by default) so the office finds it in the site menu.
Query data is only shown to people signed in to your site, so a board like this is safe to put on a public site's menu: anonymous visitors see a sign-in prompt instead of your customers.