Skip to content

Runtime data export: JSON, tables, and current Tag values

Call ExportJson, ExportTable, or ExportTags from Click Script to download current page data through the operator's browser. This serves a different purpose from Export HTML screen-package creation.

Data exportDocumentation revised: 2026-10-21

Data export: Runtime data export: JSON, tables, and current Tag values

Call ExportJson, ExportTable, or ExportTags from Click Script to download current page data through the operator's browser. This serves a different purpose from Export HTML screen-package creation.

1. Export structured JSON

ExportJson(value, fileName?) exports an object, array, or other serializable value. Its default filename is export.json. Strings remain strings. Read a JSON Tag with ReadTagJson first when exporting its structured value.

TextText
ExportJson(
  ReadTagJson("PLC_LINE01.REPORT01.SUMMARY", null),
  "line01-production-summary.json"
);

2. Export a current-page data table

ExportTable(nameOrId, fileName?, format?) supports built-in data tables on the current page. Formats are csv, json, xlsx, and excel (an xlsx alias), with CSV as the default. Supply the Table component's Name from Behavior Browser or its shapeId, with matching case. Use a unique component name; the displayed Table name is a title and cannot locate the component. The export includes all currently bound rows, including rows outside the scroll viewport, and preserves cell display text.

TextText
ExportTable("Line01ProductionTable", "line01-production.csv", "csv");
ExportTable("Line01ProductionTable", "line01-production.xlsx", "xlsx");

3. Export current Tag values and quality

ExportTags(tagNames, fileName?, format?) accepts one Tag name or a non-empty name array. It supports csv, json, and xlsx, defaulting to CSV. It exports current values without querying history. CSV / XLSX columns are Tag, Value, Quality; JSON records contain name, value, quality.

TextText
ExportTags(
  ["PLC_LINE01.PUMP01.SPEED", "PLC_LINE01.PUMP01.RUN"],
  "line01-pump-status.json",
  "json"
);

4. Preconditions and result meaning

Start downloads from a user click after data is loaded and the page has permission to read the relevant Tags. A returned filename confirms that downloading was initiated, not that the file was saved. Files go to the browser download location, not an Mingcedar server directory.

  • Missing tables, unavailable Tags, and unsupported formats report errors instead of substituting zero.
  • Existing poor-quality values retain their quality label and are not valid field readings.
  • JSON distinguishes numbers, booleans, and null. Table exports use display text.
  • The browser or host can restrict downloads. Check page feedback and download permissions when an export fails.

Click the image again or press Esc to close