This is an old revision of the document!
This document described the use of the Bizweaver DataBuilder tool. This tool is used to create JSON and XML data structures for use with web service APIs.
The following documents contain additional information that may be helpful with the development of Bizweaver workflows.
You will need to know, or have examples of , the data structures the API is expecting. This includes element (field names) and child objects within the structure. Keep in mind that names will generally require an exact match, including case.
This workflow builds three sections of a JSON structure for an SAP Business One sales order. The sections are the header, the rows, and special address information. Each section consists of a SQL statement to gather the needed information and the DataBuilder to format the information. Once the pieces are constructed, the output is sent to the SAP Service Layer API in the WebService step. Other APIs will work in a similar manner.
This should always contain the first items of the data structure.
Continue this process for all desired fields in the top-level object.
The data structure being built is displayed in the left-side panel as elements are added. The data structure cannot be altered in this area. The display is for information only.
These will be the next sections in the expected data structure. The process is the same as described in the “Main DataBuilder” step.
For objects such as a set of rows, the display will only display a single entry. However, all data received as input will be included when the workflow executes.
In most cases the lower-level sections will need to be marked as an array. The “Add as an array” checkbox should be selected. However, always check your API documentation to verify this.
All objects other than the main one will require an Object Name. This must exactly match (including case) what is expected by the API.
Once the DataBuilder steps for the lower-level objects have been created, they can be referenced in the main DataBuilder step. This is what causes the entire data structure to be created when the workflow is executed.
Here is the resulting JSON that is sent in the API call.
{
"CardCode": "C20000",
"DocDueDate": "20190313",
"DocumentLines": [
{
"ItemCode": "A00001",
"Quantity": 9,
"LineTotal": 33.75
},
{
"ItemCode": "A00001",
"Quantity": 7,
"LineTotal": 105
}
],
"AddressExtension": [
{
"CItyB": "New York"
}
]
}