Skip to main content
Version: 1.28 (Current)

Dashboard New in 2

Audience: Low-code Engineers

Skill Prerequisites: Entities, Tokens

The Dashboard module shows your app's numbers on a page: KPI tiles, charts and tables, each reading its own data. You build it in the Dashboard Builder, a full-screen editor with a live preview, by dragging widgets onto a grid and choosing what each one reads.

A dashboard on a page: a filter form at the top, four KPI tiles, a bar chart of revenue per region, a line chart of orders per month and region, and a table of customers

With a dashboard you can:

  • Show any kind of widget: KPI tiles, KPI trends, line, area, bar, horizontal bar, pie, doughnut, scatter and bubble charts, and tables. See Widget Types.
  • Read data from anywhere in your app: entities, database tables and views, SQL queries, workflows, tokens or fixed values, on this site's database or another one. See Data Sources.
  • Open the records behind a number: clicking a bar, a slice or a tile opens the records it counts, and can run actions first. See Drill-down and On Click.
  • Style each widget: colours, icons, number formats, thresholds that colour a value as it changes, and CSS classes. See Styling.
  • Filter what each widget shows, and let viewers filter the whole dashboard from a form above it. See Filters.

Add a dashboard to a page​

  1. With the page in edit mode, use the Add Module control to add a PlantAnApp Dashboard module, and drop it into the pane where you want it.
  2. On the module, choose Manage to open the Dashboard Builder.
  3. Add widgets, configure them and click SAVE.

App users see the dashboard as you saved it. Those who can edit the module also see a gear on each widget, to change its settings without opening the builder.

The Dashboard Builder​

The Dashboard Builder: the header with the dashboard's name, BACK, the AI Assistant button and SAVE; the Build tab with the widget types on the left; the canvas with Narrow, Medium and Wide on the right

The builder has three parts:

  • The header: the dashboard's name (click it to rename the dashboard), its module id, BACK, the AI Assistant button (the sparkle icon) and SAVE. Ctrl+S saves too. BACK asks first when you have unsaved changes.
  • The left pane, with two tabs:
    • Build lists the widget types. Drag one onto the canvas, or click it to add it below the other widgets.
    • Settings holds the dashboard's own settings: how long widgets keep their data, its Show Condition, Root CSS Classes, On Init actions, Filters and its layout.
  • The canvas, which shows the dashboard with live data. Above it, Narrow, Medium and Wide (or a width you type) show the dashboard at that width.

Lay out the widgets​

On the canvas, drag a widget to move it, and hover it for its resize handles. Widgets snap to a grid of 12 columns. There's always room below the widgets to drop a new one on a new row.

  • A new KPI tile is 2 columns by 2 rows. It can be as small as 2 by 1, which shows its value and title on one line.
  • A new chart is 4 columns by 6 rows, and can be as small as 3 by 4. A KPI trend starts at a KPI tile's size.

A widget keeps the same place and size at every width. On a page narrower than 768 pixels, the widgets are stacked one per row, in reading order; the builder's Narrow view shows them that way.

To delete a widget, hover it and click the delete button at its top right, or select it and click the bin next to its title. It's deleted when you SAVE.

Change a widget's settings​

Click a widget on the canvas. The left pane shows its settings, on four tabs:

TabWhat it holds
GeneralThe title, the description, the chart type, how long its data is kept, and its Show Condition.
DataThe data source and what is drawn from it: the X axis, the values, a bubble's size, the label.
StylingColours, a KPI's icon and format, how each value is drawn, thresholds and Root CSS Classes. See Styling.
ActionsThe drill-down and the On click actions.

The canvas previews each change as you make it. A tab with a field in error shows a red dot, and SAVE opens the first widget with errors instead of saving. Click the arrow next to the widget's title to go back to the Build and Settings tabs.

tip

The title, the description and the Show Condition can use tokens, replaced for each viewer: a title such as Sales in [User:Country] reads "Sales in Canada". A widget's Show Condition, for example [HasRole:Managers|true], hides it from those for whom it's false; the server doesn't send them its data either.

Grid and Custom layouts​

On the Settings tab, Layout chooses how the widgets are placed:

  • Grid (the default): widgets placed on the 12-column grid, as described above.
  • Custom: your own HTML, with a <kpi-card id="Card1"> or <chart-card id="Chart1"> element where each widget goes. Use it for a layout the grid can't make, for example headings between groups of widgets.

Switching from Grid to Custom writes the HTML for you, with the grid's widgets in reading order. Switching back puts the HTML's widgets on the grid.

Hide the dashboard from some viewers​

On the Settings tab, the dashboard's Show Condition is a token expression, for example [HasRole:Managers|true]. It's evaluated on the server for each viewer. When it's false:

  • The module shows nothing: no widgets and no message. The module's container, e.g. its title, is the skin's and still shows.
  • None of the widgets' data or On click actions are served to that viewer, even when asked for directly.

Those who can edit the module still see the dashboard in edit mode, with a note that it's hidden by its Show Condition, and always in the builder. Each widget's own Show Condition still applies inside a dashboard that's shown.

The Show Condition isn't a permission: the module's View permission still decides who can reach the page.

Run actions before the dashboard loads (On Init)​

On Init, on the Settings tab, is an action list that runs on the server, as the viewer, once before the dashboard is drawn. Use it to look up something the widgets need, such as the viewer's region, or to send some viewers elsewhere with Redirect to URL.

  1. Under On Init, click Edit actions, add the actions and click Done.
  2. In Keep for the widgets, list the context variables the actions set, one name per line, e.g. Region.
  3. Click SAVE.

The widgets read each kept value as a token, e.g. [Region]: in their Show Condition, data source (SQL query, WHERE clause, Token and Constant values), title, description, thresholds, Root CSS Classes and On click actions. The dashboard's own Show Condition, Root CSS Classes and Custom HTML read them too.

  • The actions are those a form's On Page Load offers. Actions that answer in the browser, such as Display Message or Execute JavaScript, aren't offered, because the page isn't drawn yet.
  • A redirect or an error applies to everyone, including those who can edit the dashboard. The builder still opens; it runs On Init as you, ignoring redirects and errors, so its previews use your values.
  • The values stay as they were when the page loaded until the page is reloaded, also when widgets update automatically. They travel to the widgets encrypted and signed for that dashboard and that viewer, so a viewer can't read or change them.

Build charts with the AI Assistant​

The sparkle button in the header opens the AI Assistant. Describe the chart you want, for example "new customers per month, next to the revenue chart", and it writes the SQL query from your database's tables and columns, chooses the chart type and places the chart. Ask for changes in words, or edit the chart by hand. Undo puts the dashboard back as it was before your request.

The assistant sees your tables and columns, never their rows. It needs the OpenAI add-on and a connector to a model.

Who can do what​

  • Those who can edit the module open the builder and change every widget.
  • Only Low-code Engineers and the roles above them (Administrators and superusers) can write or change a widget's SQL: its query, its records query or its WHERE clause. Others see the SQL read-only, and can change everything else.
  • App users view the dashboard. A widget reading an entity shows only the records they can read.

Keep the data fresh​

  • Keep data for, on the dashboard's Settings tab, says how long a widget's data counts as current: 5 minutes for a new dashboard. The server reads each source once in that time and serves it to every viewer. A widget can have its own time on its General tab. Always read it again keeps nothing.
  • Update the page automatically, off by default, reloads each widget when its data expires. When it's off, a widget whose data is out of date shows a clock after its title; click it to load the widget again.

Export and import​

A dashboard exports and imports with its module, like other Plant an App modules: DNN's Export and Import Content, page and site templates, and version control between environments. Widgets of entities find their entity again on the other site.

A drill-down is kept only when its listing comes along on the dashboard's own drill-down page, for example with a site template or version control. Otherwise, the widget has no drill-down on the other site until you Create listing again. Copying a page doesn't copy its child pages, so a copied dashboard has no drill-downs.

Deleting the dashboard module moves it to the recycle bin, and restoring it brings the dashboard back. When the module is deleted for good, its dashboard, widgets and actions are deleted, and its drill-down listings go to the recycle bin.

Dashboards from earlier versions​

Existing dashboards keep working. Templates are retired, and each dashboard is converted the first time it loads:

  • A dashboard that used the Default template opens with the Grid layout: its four tiles, Card1 to Card4, in a row, with their settings.
  • A dashboard that used any other template opens with the Custom layout, with its own copy of that template's HTML. Editing it no longer changes other dashboards that used the same template.
  • A dashboard's refresh rate becomes its Keep data for, with Update the page automatically on, so it keeps updating as before.
caution
  • The dashboard's tables moved to the paa schema. SQL written against the old PlantAnApp_Dashboard* tables stops working.
  • Users who can edit a dashboard but aren't Low-code Engineers or above can no longer add or change a widget's WHERE clause. Their widgets keep working.