This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
bw2:databuilder_tool [2021/02/11 17:36] akoehler |
bw2:databuilder_tool [2022/08/02 15:33] (current) akoehler |
||
|---|---|---|---|
| Line 21: | Line 21: | ||
| - Input will generally be from a SQL Reader step. | - Input will generally be from a SQL Reader step. | ||
| - The example used on this page is for JSON. The same general process is also used for XML. | - The example used on this page is for JSON. The same general process is also used for XML. | ||
| + | - When working with decisions, the Databuilder tool in a branch of a decision will only reference Databuilder tools in that same branch. | ||
| ====== General Process ====== | ====== General Process ====== | ||
| Line 50: | Line 51: | ||
| - **Field Type:** This can either be String, Numeric, Boolean, or an Array built later in the workflow. | - **Field Type:** This can either be String, Numeric, Boolean, or an Array built later in the workflow. | ||
| - **Value:** Normally a variable from the connected SQL/HANA step. These can also be hard-coded values. | - **Value:** Normally a variable from the connected SQL/HANA step. These can also be hard-coded values. | ||
| - | - **Add Row or Delete: | + | - **Add Row or Delete: |
| ======JSON Example====== | ======JSON Example====== | ||
| + | Below is an example of how to build a basic JSON File. The data is coming from SAP but this concept applies to any API being used to pass data to. | ||
| + | {{ : | ||
| + | |||
| + | * Start by getting all the data needed and process that through a loop as we only want to process one record at a time in this example. | ||
| + | * **Note** Most APIs are case-sensitive. | ||
| + | * Once the data is sent into the loop you will limit it down to one record and add link it to the next step which is the data builder step | ||
| + | * Note Top-Level Element is selected. In this example, we are adding one record at a time | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | <WRAP center round tip 80%> | ||
| + | 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. **At the same time**, the " | ||
| + | </ | ||
| + | |||
| + | <WRAP center round important 80%> | ||
| + | When creating lower-level section that __may__ have more than one entry (i.e. an array), be sure to put the DataBuilder tool within a **Loop**. | ||
| + | </ | ||
| + | |||
| + | * Once the data is mapped add another loop to process all lines. This will be built as an array. The Create New Object is filled in as it is needed to identify the array. | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | * Once the lines data builder step is built you will then return to the header data builder step and it will now appear in the field type dropdown. Select it and it will now add the array to the header data builder step once it processes. | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | * Once the JSON is built it the Cumulative data variable from the Header step can be used and entered into the body section of a Web Service 2 tool to then be sent through the API. | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | |||
| + | ====Databuilder Variables==== | ||
| + | ^Name ^ Description | ||
| + | |AddAsArry|True or False if the add as array checkbox is selected| | ||
| + | |CumulativeData|This is the collection of all data that was built in the databuilder| | ||
| + | |Data|This is the last run of data that was entered into the databuilder| | ||
| + | |DataSourceName|This indicates the name of the tool that is being used for the source data for the databuilder| | ||
| + | |DataType|This indicates the type of data your are building XML or JSON| | ||
| + | |ObjectName|Is the name of the top level of your JSON or XML| | ||
| + | |TopLevelElement|True or False if the top level element checkbox is selected| | ||
| + | | StepMessage|During a failure the reason for failure will be populated here | | ||
| + | | StepStatus | ||