Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Overview

The built-in WebData Editor allows you to define the data structure for WebData Editor (Reference) provides an integrated environment for defining and editing JSON, XML, HTML, and text content.

The Encoding drop-down menu is read-only on the WebData Editor. The definition of the data format must be made when creating the WebData object.

data structures with dynamic tag binding. The WebData Editor enables:


  • Visual editing of data structures
  • Real-time tag binding
  • Syntax highlighting and validation
  • Request/response mapping
  • Template creation
  • Format-specific tools


Access via Reports → WebData Editor

In

On

this page:

Table of Contents
maxLevel

3

2
minLevel2
indent10px
excludeSteps
stylenone



Reports → Tutorial | Concept | How-to Guide | Reference



Editor Interface

Selecting

the

WebData

Object

Objects

    Go
  1. Navigate to Reports
  2. / WebData and select one object in the Table or Create a new one.
  3. Go to Reports / Web Data Editor. The selected WebData content will be used by the editor.

In order to select other documents, or create new ones, the ComboBox and the Document Toolbar on top of the editor can be used. 

Editing the Content

  1. → WebData
  2. Select existing object or create new
  3. Open Reports → WebData Editor
  4. Selected object loads automatically

Navigation Controls

  • ComboBox - Switch between WebData objects
  • Document Toolbar - Create, save, delete operations
  • Encoding Selector - Read-only, shows current format

Tag Binding

Syntax

Embed tag values using curly brackets:

{Tag.TagName}

Examples by Format

JSON:

json

{
  "deviceId": "SENSOR-001",
  "timestamp": "{Info.Date}",
  "measurements": {
    "temperature": {Tag.TankFarm/Tank1/Temp},
    "pressure": {Tag.TankFarm/Tank1/Pressure},
    "level": {Tag.TankFarm/Tank1/Level}
  },
  "status": "{Tag.Equipment/Status}"
}

XML:

xml

<SensorData>
  <DeviceID>SENSOR-001</DeviceID>
  <Timestamp>{Info.Date}</Timestamp>
  <Temperature>{Tag.TankFarm/Tank1/Temp}</Temperature>
  <Pressure>{Tag.TankFarm/Tank1/Pressure}</Pressure>
  <Status>{Tag.Equipment/Status}</Status>
</SensorData>

HTML:

html

<html>
<body>
  <h1>Production Report</h1>
  <p>Date: {Info.Date}</p>
  <p>Total Production: {Tag.Production_Count}</p>
  <p>Quality Score: {Tag.Quality_Score}%</p>
</body>
</html>

Text:

Device Report
=============
Date: {Info.Date}
Temperature: {Tag.TankFarm/Tank1/Temp} °C
Pressure: {Tag.TankFarm/Tank1/Pressure} PSI
Status: {Tag.Equipment/Status}

Bidirectional Data Flow

Sending Data (Outbound)

Tags replace placeholders when sending:

json

// Template
{"name": "{Tag.UserName}"}

// If Tag.UserName = "John"
// Sent as:
{"name": "John"}

Receiving Data (Inbound)

Tags populate from received content:

json

// WebData Template
{"temperature": "{Tag.Temp}"}

// Received Data
{"temperature": 25.5}

// Result: Tag.Temp = 25.5

Nested JSON Handling

When binding tags to nested JSON objects:

Template:

json

{
  "data": "{Tag.SensorData}"
}

Received:

json

{
  "data": {
    "id": 175,
    "values": [10, 20, 30],
    "status": "active"
  }
}

Result: Tag.SensorData receives entire nested object:

json

{
  "id": 175,
  "values": [10, 20, 30],
  "status": "active"
}

Editor Features

Syntax Highlighting

  • Keywords in blue
  • Strings in green
  • Numbers in red
  • Tags in orange
  • Comments in gray

Validation

  • Real-time syntax checking
  • Tag existence verification
  • Format-specific rules
  • Error indicators

Auto-Completion

  • Tag name suggestions
  • Format keywords
  • Common patterns
  • Template snippets

Best Practices

JSON Documents

json

{
  // Use consistent indentation
  "metadata": {
    "version": "1.0",
    "timestamp": "{Info.Date}"
  },
  // Group related data
  "measurements": {
    "temperature": {Tag.Temp},
    "pressure": {Tag.Pressure}
  },
  // Handle arrays properly
  "values": [
    {Tag.Value1},
    {Tag.Value2}
  ]
}

XML Documents

xml

<!-- Use proper nesting -->
<Root>
  <!-- Group related elements -->
  <Measurements>
    <Temperature unit="C">{Tag.Temp}</Temperature>
    <Pressure unit="PSI">{Tag.Pressure}</Pressure>
  </Measurements>
  <!-- Use attributes wisely -->
  <Status code="{Tag.StatusCode}">{Tag.StatusText}</Status>
</Root>

Error Handling

json

{
  "status": "{Tag.Status}",
  "error": "{Tag.ErrorMessage}",
  "retry": {Tag.RetryCount}
}

Common Patterns

API Request Body

json

{
  "method": "getData",
  "params": {
    "startDate": "{Tag.StartDate}",
    "endDate": "{Tag.EndDate}",
    "filters": {
      "location": "{Tag.Location}",
      "type": "{Tag.DataType}"
    }
  }
}

Configuration Template

json

{
  "settings": {
    "interval": {Tag.UpdateInterval},
    "threshold": {Tag.AlarmThreshold},
    "enabled": {Tag.SystemEnabled}
  }
}

Status Report

xml

<StatusReport>
  <Timestamp>{Info.Date} {Info.Time}</Timestamp>
  <System>
    <Running>{Tag.System_Running}</Running>
    <Uptime>{Tag.System_Uptime}</Uptime>
  </System>
  <Production>
    <Count>{Tag.Production_Count}</Count>
    <Rate>{Tag.Production_Rate}</Rate>
  </Production>
</StatusReport>

Troubleshooting

Tag not replacing:

  • Verify tag name and path
  • Check curly bracket syntax
  • Confirm tag has value
  • Review encoding format

Invalid JSON/XML:

  • Check bracket/tag matching
  • Verify quotes in strings
  • Remove trailing commas
  • Validate against schema

Data not populating:

  • Match template structure
  • Verify property names
  • Check data types
  • Review nested paths

Performance issues:

  • Minimize document size
  • Reduce tag count
  • Optimize nested structures
  • Cache static content



In this section...

Page Tree
root@parent
spaces93DRAF

Adding Binding to Real-Time Tags

When reading the file with the Data (or sending to a WebService), you replace parts of the text by Tags. To do that, surround the tag name with curly brackets.

Eg.:   Replace "Name" :  "John Robinson" by  "Name" : "{Tag.MyTagWithTheName}"

The value of Tag.MyTagWithTheName will be used when reading the file or data package.

When loading files from disk, or receiving data packages from WebServices, the operation is reversed. If Tags are used, they will be populated with contents after parsing the contents of the received data.

In case of populating tags with received data contents, when using tags in JSON properties that contain another internal JSON, the content of the JSON, including all its properties, will be assigned to the tag.

Eg.: 

WebData Editor Content:

Code Block
{
	"slip": "{Tag.Advices}"
}

Received Data:

Code Block
{
	"slip": {
		"id": 175,
		"advice": "Plant a tree."
	}
}

The tag "Advices" will receive the value:

Code Block
{
	"id": 175,
	"advice": "Plant a tree."
}

Best Practices for Document Formatting

Proper formatting of WebData documents helps ensure that tag binding works as expected and that queries execute correctly.

In this section:

Page Tree
rootV10:@parent
spacesV10