How to retrieve data from JSON file when column header values include white spaces
This article helps in getting the data from the JSON files for the column header fields which have white spaces included in them.
Instructions
- Log in to Confluence.
- Go to an existing page and edit the macro. Go to step # 3.
- If new page, then insert the JSON Table macro in the Confluence page.
If there are any white spaces included (for example, as shown in the JSON data below, the fields App Name and Product Category) and if one try to pass the field names as is, then you will get an error: Error rendering macro json-table: Space not allowed in path.
[{"Tools":["Both"],"Role":["Support Engineer"],"Name":["K S"],"User":["test.user"],"App Name":["Bobswift"],"Product Category":["BI reporting"]}]
Here is the below screenshot with the error message as stated above.- To avoid this error and to render the data by escaping the white spaces, the field names should be given as ['App Name'],['Product Category'], then the results will be similar to the one as shown below:
You can save the settings and Publish the page.
- Ensure that the Advance Tables for Confluence is installed and the macro is available to use.
- The sample page for the JSON data is at Build an Advanced Table from Rest API Data 8.x