Overview
The built-in WebData Editor allows you to define the data structure for
In the Web Data Editor, you can create, modify, or delete data entries according to your project requirements.
You can write a webdata in JSON, XML, HTML or a plain Text. You can also switch between both. If you change your language selection in the code editor, the system automatically converts existing code to the selected language, 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.
On this page:
Table of Contents | ||||
---|---|---|---|---|
|
Selecting the WebData Object
- Go to Reports / WebData and select one object in the Table or Create a new one.
- Go to Reports → / Web Data Editor.
- Select the WebData entry you want to edit from the list
From the drop-down list in the main toolbar, select the webdata created in WebData window you want to edit. To create a new task or class, see Report WebData earlier on this page.
If needed, select a different text language from the code editor toolbar.
You can also format your code to be more readable. To do so, click Auto Format. A prompt will appear; click OK.
Click Save.
When Selecting Reports → WebData Editor, the Code Editor environment is displayed with the contents of the last selected WebData.
While in that environment, you can change the WebData are editing using the ComboBox at the top area.
- 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
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.
Check the WebAccess REST API page for additional information.
In this section:
Page Tree | ||||
---|---|---|---|---|
|