Skip to main content

Debugging

When it comes to debugging connectivity or data problems there are two options. The first is to return the json response into a column for each row item. The second is to write the full json document to the trace in the output window of Data Sync.

JSON Response Column

You can add a column to the StaticSchemaMap to hold a copy of the row json object so you can see the raw json per row in the Data Sync data preview. You would then add a ColumnMap to the DataTableTransform function to map the json to the column like this:

<Datasource name="fxrates">
<Action name="GetDataSchema">
<StaticSchemaMap>
<Column name="Currency" data-type="System.String" key="true" />
<Column name="Rate" data-type="System.Decimal" />
<Column name="__json" data-type="JToken" />
</StaticSchemaMap>
</Action>
<Action name="GetDataTable">
<ReadFile path="fxrates.json">
<DataTableTransform>
<ColumnMap path="$" to="__json" />
</DataTableTransform>
</ReadFile>
</Action>
</Datasource>

Write to the Output Window

You can trace the entire JSON document to the Data Sync Output window by using the TraceElement action type like this:

<Datasource name="fxrates">
<Action name="GetDataSchema">
<StaticSchemaMap>
<Column name="Currency" data-type="System.String" key="true" />
<Column name="Rate" data-type="System.Decimal" />
</StaticSchemaMap>
</Action>
<Action name="GetDataTable">
<ReadFile path="fxrates.json">
<DataTableTransform />
<TraceElement />
</ReadFile>
</Action>
</Datasource>