Hongmu Notes

Convert interface return value to table

Converting the interface return value to a table turns the JSON response into a table: field names are at the top, values are at the bottom, and abnormal data is visible at a glance.
100% Browser local processing 0 Data upload

📥 Conversion settings

💡 Instructions for use

  • Arrays of objects (one object per row) are best for export: field names automatically become table headers, and fields are ordered by first occurrence in each row.
  • The two-dimensional array (one array per row) is spread out in the original order, and the first row is usually used as the field name row; select "No" to not write the field name row.
  • When some rows have fewer fields than other rows, the missing positions are filled with blanks or zeros according to the "How to handle missing fields" setting to avoid misalignment of the entire column.
  • It is recommended to preview before exporting: the preview and exported files use the same data. If the preview is correct, the file content will be consistent.
  • Excel is downloaded in xlsx format and can be opened directly with spreadsheet software; CSV is suitable for importing into a database or script processing.
  • The pasted content is only parsed and generated in the browser, and is not uploaded or saved; you need to paste it again after refreshing the page.

Converting the interface return value to a table turns the JSON response into a table: field names are at the top, values are at the bottom, and abnormal data is visible at a glance.

Difficulties viewing large sections of JSON

There are many records returned by the interface, and it is difficult to compare the values of the same field in different records in text form: a certain field is missing, a certain value is empty, and a certain type is wrong. You have to look through it paragraph by paragraph to find out. After being converted into a table, the same fields are aligned vertically, and deficiencies and anomalies are immediately apparent, making it more straightforward to troubleshoot data problems and explain phenomena to the business side.

Handling of common return structures

  • Standard paging structure: automatically take out the array fields as data rows.
  • Fields are scattered in different records: columns are merged according to fields that appear in all records, and columns will not be lost.
  • Contains nested objects: The entire paragraph is written as text. When columns need to be split, it is processed in the data source first.

Copy the returned example from the interface document and paste it directly for conversion, which is suitable for quickly confirming fields and structures. If the interface returns paginated data, it is recommended to get the full amount first and then convert it, otherwise there will only be the content of the first page in the table.

It is recommended to use a formatting tool to organize the indentation before pasting. It is easier to find field level problems when the structure is clear. If the data contains escape characters, it should be restored before conversion to avoid redundant backslashes.

If the interface field name contains Chinese characters, it is recommended to map it to a standardized name before exporting.

When field integrity needs to be checked, gaps are easier to see in tables than in raw JSON.

📖 Glossary

JSON
A universal data exchange format that uses curly brackets to represent objects and square brackets to represent arrays. It is commonly used in front-end and various interfaces.
object array
It is shaped like an array with one object in each row. The key of the object is the field name. It is most suitable to be directly converted into a table.
two-dimensional array
Each element is also an array of arrays. The position of the element determines which column it falls in. You need to manually confirm the meaning of the column.
Field name row
The first row of the table is used to describe the meaning of each column. The field names of the object array will automatically become this row.
worksheet
A table in an Excel file. One file can contain multiple sheets. This tool exports one sheet at a time.
xlsx
The current Excel file format supports multiple worksheets, styles and data types, and is compatible with mainstream spreadsheet software.
CSV
Comma-separated plain text table format, small in size and easy to be processed by scripts, but does not retain styles and types.
key order
The order in which the fields are arranged from left to right in the table is determined by this tool based on the first occurrence in each row.
Nested objects
When an object or a multi-layered array is embedded in an object, the entire content will be written into the cell as text during export.
Missing fields
For fields that are not found in some rows, leave them blank or fill them with zeros when exporting to avoid misalignment of the entire row.

🔗 All keywords and tutorials

Keywords page of the tool12a

Return to tool home page

❓ FAQ

Can the multi-layer structure of paginated data be processed??
The first array field will be taken out as data; if the data is hidden in a deeper level, please copy the array first and then paste it.
Can the original order be preserved??
The row order is consistent with the array, and the column order is determined by the first occurrence of the fields.