Hello,
I’ve an API Data page with Datastructure based on Virtual entity and Workflow as a Datastructure Method. Input data are in structured JSON format like this:
{
"type": "DG",
"id": "3656453548",
"data": [
{
"time": "2024-05-07 22:11:20",
"value1": 30.5263,
"value2": 12.4213
},
{
"time": "2024-05-09 22:11:20",
"value1": 31.5263,
"value2": 13.4213
}
],
"config": {
"conf1": 5,
"conf2": 300,
"conf3": 30,
"url1": "https://url1/api/public/1",
"url2": "https://url2/api/public/2"
},
"state": {
"state1": 6,
"state2": 3,
"state3": 1
}
}
Input JSON is correctly converted to XML, where the transformation takes place in the Workflow step. Then I need generate and return JSON data with similar structure as input JSON. Actually if the transformation WF step output looks like:
<?xml version="1.0" encoding="utf-8"?>
<ROOT>
<IAPI>
<type>DG</type>
<success>true</success>
<config>
<conf1>7</conf1>
<conf2>320</conf2>
</config>
<state>
<state1>1</state1>
<state2>4</state2>
</state>
</IAPI>
</ROOT>
it is merged to:
<ROOT>
<IAPI>
<type>DG</type>
<success>true</success>
<state2>4</state2>
<conf1>7</conf1>
<state1>1</state1>
<conf2>320</conf2>
</IAPI>
</ROOT>
Is there a way to model the datastructure so that the conversion to structured JSON format takes place?
Thank you.