SQL Table+
SQL Table+ shows the rows of an AF table on a PI Vision display and lets operators sort, filter, group, and color them. In write mode it also edits a static AF table.
Overview

Watch the demo
See SQL Table+ in a practical PI Vision workflow.
When to use it
Use this symbol when you need to:
- Show a static AF table, a linked CSV file, or a linked SQL table on a display.
- Keep only the rows inside the display time range.
- Show only the rows that match a condition, or only the rows of the selected asset.
- Color cells and rows by value so that errors stand out.
- Group a long table by a column such as the production line.
- Let authorized users edit the records of a static AF table.
Choose Time Series Table+ when the rows are PI Point or attribute values over time, or Events Table+ when the rows are event frames.
Before you begin
- Create the AF table in PI System Explorer. It can be a static table, a linked CSV file, or a linked SQL table.
- To look the table up from the display's asset, add an attribute of an asset to the symbol. The attribute must be in the AF database that holds the table. Without an attribute, choose the AF server and AF database in the pane instead.
- For a linked SQL table, link a database view or a query that returns only the rows the display needs. The filters of SQL Table+ run in the browser, so a smaller query loads faster. SQL decimal columns are not supported: cast them to float in the link query.
- To edit rows, use a static table and make sure the users have write permission to it.
Add and set up the symbol
- Select SQL Table+ in the PI Vision symbol gallery, and drag an attribute of an asset onto the display.
- Right-click the symbol and select Configure Table....
- Under Table, set Source (1) to its first option. It looks the table up in the AF database of the first data source.
- Select the table in AF Table (2). The columns of the table appear under Columns.
- Click an empty point of the display. The symbol lists every row of the table.


To pick the AF server and database yourself, set Source to Custom. A display that uses Custom cannot be moved to another PI Vision server without choosing the table again.
Common tasks
The screenshots use an event log table named WriteTable. Each task continues from the previous one. The display time range runs from 5/13/2023 12:00 PM to 5/14/2023 12:00 AM.
Show only the rows in the display time range
Use this when the table has a DateTime column and operators move the display time range.
- Right-click the symbol and select Configure Table....
- Under Columns, select the DateTime column, here Time (1).
- Select Filter (2).
- Keep Mode (3) on Display Time.

The table keeps the rows whose time is inside the display time range. When no row falls inside the range, the table shows only its column headers.

Choose and label the columns
Use this when the table has helper columns or technical names that operators should not see.
- Under Columns, select a column in the list (1).
- Set Show (2) to OFF to hide it. Hide TimeConverted, Byte, and Temperature this way.
- Select Location, set Label (3) to Custom, and enter
Line. - Choose the Alignment (4) of the values.

The table shows the visible columns, and the header of Location reads Line.

Show only the rows that match a condition
Use this when one table holds rows for several purposes and a display needs one slice, such as the errors of one line.
- Under Filter, set Enabled (1) to ON and Mode (2) to Basic.
- Select + Add Condition (5).
- Set Column (3) to Type, keep the equals comparison, set Value Type to Custom, and enter
Erroras the Value (4). - Add a second condition with Column set to Location and Value set to
Line 2.

A row must match every condition. The table keeps the errors of line 2.

To combine conditions with or, set Mode (1) to Advanced, type an expression in the field (2), and select Apply (3). Use the column names, put text in double quotes, and group with parentheses. The field turns green while the expression is valid.

To follow a live value, set Value Type (2) to its first option, and select the data source (3). In Advanced mode, write '[1]' for the first data source. The condition in the image keeps the rows where Location equals the Name attribute of the asset. The table then follows the asset switcher.

Filter the table from other symbols
Use this when operators narrow the table by clicking values in another symbol.
- Add SQL Filter+ on the same AF table, and set its Value to a column, such as Type.
- Click a value in SQL Filter+.
The table shows only the matching rows. A filter chip in the corner of the table shows the count, such as 16 of 143 rows. Clear the selection in SQL Filter+ to see every row again.

To follow a symbol that uses other data, open Filtering here, select Add Input, enter the Channel of that symbol and set Target to a column. To keep this table out of filters on the same table, set Ignore Master to ON.
Color cells by state
Use this when operators must spot errors and warnings without reading every row.
- Right-click the symbol and select Configure Multi-State....
- Select the column, here Type (1), and select Enable Multi-State (2).
- Set Property (3), here to Solid Fill.
- Under Status, enter the value
Error(5) and select +. AddWarningandInfothe same way. - Select the color of each state (6).

Cells with a listed value take its color. A cell with another value keeps the table color.

Select Apply to row (4) to color the whole row with the state of the cell.

Group rows by a column
Use this when operators read a long table by line, unit, or status.
- Under Columns, select Location (1).
- Set Group (2) to ON.
- Under General, select Count so that each group header shows its row count.
- Clear Auto Expand to start with every group collapsed.

In the second image, (1) marks Auto Expand and (2) marks Count.

The table shows one header per value, such as Line 1 (22). Click a header to expand or collapse its rows.

Use the symbol

| What it shows | |
|---|---|
| (1) | Column header. The arrow marks the column that sorts the rows. |
| (2) | Column filter box, shown when Column Filters is on. |
| (3) | Group header with the row count. Click it to expand or collapse the group. |
| (4) | A value colored by multi-state, here with a status dot. |
| (5) | Row number, shown when Show Row Number is on. |
- Sort. Click a column header to sort by it, click again to reverse the order, and click a third time to return to the AF table's own row order.
- Filter a column. Type in the box below a header. Text columns match any part of the text, and ignore case. Numeric columns have Min and Max boxes. Boolean columns offer a list.
- Open a link. A cell that holds a web address shows a link icon. Click it to open the address in a new tab. When Link is on for the column, Open in chooses the place. Only addresses that start with http or https open.
- Reload. The table reloads on its own every minute by default. It also reloads when the display time range, the asset, or the table changes.
- Read-only mode writes nothing. Sorting, filtering, and grouping change the view only.
- Export. A CSV, PDF or Excel export holds the rows on screen. Rows that a filter hides are left out.
Edit rows in write mode
Write mode edits the AF table itself. Use it only on a static table. Set Mode under General to Write, and a toolbar appears below the table.

| What it does | |
|---|---|
| (1) | Undo and redo the edits made since the last save. |
| (2) | Copy, paste, import a CSV file, and export a CSV file. |
| (3) | Reload the table, and delete the selected rows. |
| (4) | Add an empty row. |
| (5) | Save the table. It is dimmed until something changed. Ctrl+S saves too, but only when edits are pending. |
- Click a cell to edit it. A column with Allow Edit off stays read-only.
- Select rows with the check boxes at the left to delete them. With Range Selection on there are no check boxes: click a cell or a row number, or drag over several, then select delete. Until you do, delete is dimmed and removes nothing.
- Import CSV adds one row per line of the file and skips the first line as a header.
Important: Save writes the whole table back to AF, where other displays and users read it. Edits stay in the browser until you save, and the table does not reload while edits are pending. If a save fails, you see the error and the edits and undo history stay, so you can fix the cause and save again. Save keeps every column of the table, and every row, also the rows a filter hides.
A filter from another symbol can arrive while you edit. Your edits stay, an edited row stays in or out of view by its loaded value, and a row you added stays visible. Selected rows that the filter hides are deselected.
Configure the symbol
Right-click the symbol and select Configure Table.... The pane has the sections Table, Query Parameters, Columns, General, Filter, a data sources section, Style, and Export Data. Multi-state colors have their own command, Configure Multi-State....
Table
| Setting | What it does |
|---|---|
| Source | The first option looks up the table, by name, in the AF database of the first data source, so the table follows the asset. Custom uses the AF server and database you choose. Shown when the first data source is an attribute. |
| AF Server, AF Database | The AF server and database. Available when Source is Custom. |
| AF Table | The table to show. Choosing a table loads its columns. |
Query Parameters
Use these for a linked SQL table whose query has parameters. The pane only supplies values. The matching parameters and predicates must already exist in the linked table in PI System Explorer.
| Setting | What it does |
|---|---|
| Parameter Name | The name of the parameter, which must match the table and start with @. |
| Value Source | Display Start Time or Display End Time send the display range as ISO timestamps. Custom sends the text you enter. A data source sends its current value, which must be a single value. |
| + Add Parameter, Delete | Add or remove a parameter. |
The server filters the rows before they reach the browser. A table with parameters is read-only, whatever Mode says. The PI Web API version must support the parameters argument of the table data call.
Columns
Select a column in the list, then set it. The arrows under the list move it up or down. Reload reads the columns of the table again, for example after a column was added in AF.
| Setting | What it does |
|---|---|
| Show | Shows or hides the column. |
| Label | Default uses the AF column name. Custom shows the name you enter. See Choose and label the columns. |
| Units, Tooltip | Units adds text after each value. Tooltip shows text when the pointer rests on the header. |
| Alignment | Left, center, or right. |
| Allow Edit | Allows editing of the column. Available in write mode. |
| Input Type | Input accepts typed text. List offers the items you add. Available in write mode when Allow Edit is on. |
| Link | Turns the cell text into a link. Open in chooses Current Tab, New Tab, or Dialog Window. Available for text columns. |
| Group | Groups the rows by this column. See Group rows by a column. |
| Filter, Mode | Filters the rows by the display time range. Available for DateTime columns. See Show only the rows in the display time range. |
| Format, Decimals | General shows the value as it is. Number, Percent, and Scientific use the Decimals you pick. Available for Double columns. |
General
| Setting | What it does |
|---|---|
| Mode | Read Only or Write. Write adds the toolbar to edit and save the table. Static tables only. When the table has query parameters, a note under the switch says it stays read-only. |
| Auto Reload, Reload Every | Reloads the table on a timer. On by default, every 1 minute. The shortest effective interval is 5 seconds. Turn it off for tables that do not change on their own. |
| Layout | Fit Data sizes each column to its content, Fit Table Width fills the width, Manual keeps the widths you drag. |
| Range Selection | Lets users select a block of cells and copy it. |
| Column Headers, Column Filters, Show Row Number | Show or hide the headers, the filter boxes, and the row numbers. Text filters match part of the text, ignoring case, and accept * and ?. |
| Allow Sorting | Lets users sort by clicking a column header. On by default. Turn it off to always show the rows in the AF table's own order, for example when the table uses separator rows. |
| Wrap Text | Wraps long text. Off clips it. |
| Right to Left | Reverses the reading direction. |
| Paging | Splits a long table into pages. Not available when Wrap Text is on. |
| Auto Focus Row, Row | Scrolls to the First or Last row after each load. |
| Auto Expand, Count | Group headers start expanded, and show the row count. Available when a column is grouped. |
Filter
| Setting | What it does |
|---|---|
| Enabled | Turns the filter on or off without losing the conditions. |
| Mode | Basic uses conditions. Advanced uses an expression. See Show only the rows that match a condition. |
| Column, Operator, Value Type, Value | One condition. The comparisons are equals, not equal, greater than, greater than or equal, less than, and less than or equal. With the data source value type, the condition compares with the live value of a data source. All conditions must match. |
| + Add Condition, Delete | Add or remove a condition. |
| Expression, Apply | An expression such as Type == "Error" or Priority > 5. Use '[1]' for the value of the first data source. An invalid reference shows an error and hides every row until you fix it and select Apply. |
Filtering
| Setting | What it does |
|---|---|
| Filter Indicator | How the filter chip shows: COMPACT is an icon until you point at the symbol, FULL always shows the count, HIDDEN shows no chip. The chip always shows while the table waits for a linked filter. |
| Ignore Master | ON keeps out the filters of symbols on the same AF table, such as SQL Filter+. Linked inputs still apply. |
| Add Input, Channel, Target | A linked filter from any symbol: the table shows the rows whose Target column holds the published value. Several inputs must all match. |
| No Selection | What an input does while its channel has no selection: ALL shows every row, NONE shows no row until a value arrives. |
Data sources
The data sources section lists the attributes or PI Points of the symbol. They supply the table lookup, query parameter values, and the values for filters. Reordering them keeps the '[n]' references of filters in step. Deleting a data source that a filter uses breaks that filter.
Style
| Setting | What it does |
|---|---|
| Theme, Container Style, Comfortable, Apply to all symbols | Set the table appearance. Choose Custom Theme for colors, fonts, borders, and row heights. See Themes and container styles. |
Export Data
| Setting | What it does |
|---|---|
| File Format | CSV, JSON, XLSX, or PDF. |
| Download | Downloads the table. The command Export Data... on the right-click menu opens this section. |
| PDF settings | For PDF: Style (Modern or Classic), Title, Orientation, Font Size, Padding, and Colors. |
Multi-state
Right-click the symbol and select Configure Multi-State.... See Color cells by state.
| Setting | What it does |
|---|---|
| Enable Multi-State | Colors the column by state. Available for text, number, and Boolean columns. |
| Property | Text, Border, Soft Fill, Accent + Tint, Status Dot, Value Badge, Solid Fill, Progress, or Progress and Value. |
| Apply to row | Applies the color of the cell to the whole row. |
| Status | The states. For a text column, enter a value and select +. You can use * as a wildcard, as in Pump*. For a number column, each state covers the values up to its limit, and an empty cell has no state color. A Boolean column starts with False red and True green. |
Troubleshooting and limitations
| Symptom | Cause | What to do |
|---|---|---|
| The table shows only its headers. | Filter on a DateTime column removes every row outside the display time range, or a filter condition matches no row. | Change the display time range, or check the filter settings. |
| No Table Selected appears. | No table is chosen. | Select a table under Table. |
| The table is empty after the asset changed. | The AF database of the new asset has no table with that name. | Use an asset in the same database, or set Source to Custom. |
| The table shows fewer rows than the AF table, with a filter chip in its corner. | A filter from another symbol applies. | Clear the selection in that symbol, or set Ignore Master to ON under Filtering. |
| The table shows no rows and the chip reads Waiting for filter. | A linked input with No Selection set to NONE has no value yet. | Select a value in the publishing symbol, or set No Selection to ALL. |
| A column added in AF is missing. | The column list is read when you pick the table. | Select Reload under Columns. |
| Every row disappeared after you deleted a data source. | An advanced expression still refers to it with '[n]'. | Replace the reference and select Apply. |
| Save is dimmed. | Nothing has changed since the last save. | Edit a cell, add a row, or delete a row. |
| A save answers Not saved: the server's time conversion ... could not be confirmed. | The server did not answer how to store the table's DateTime values, or the table's settings changed after it loaded. Nothing was written, and your edits are kept. | Save again. If the message stays, reload the table, which discards your edits. |
| A save answers Not saved: ... cannot be stored in this table. | The server has no clock time for that value: the first pass of the hour repeated when clocks go back, or a date before 1970. Nothing was written. | Change the cell it names, and save again. |
| The table cannot be edited. | The table has query parameters (the note under Mode says so), or Mode is Read Only. | Remove the parameters, and set Mode to Write. |
Limitation: Linked SQL tables are read-only, and SQL decimal columns are not supported.
