This article helps in getting the data from the JSON files for the fields which have white spaces included in them.
...
- Log in to Confluence.
- Insert the JSON Table macro in a Confluence page.
- Input the JSON data through the Method of locating script or follow the instructions mentioned in the Build an Advanced Table from Rest API Data 8.x article and save the macro settings.
The article in Step
4 works3 i.e., Build an Advanced Table from Rest API Data 8.x works fine if the field names in the JSON data don't have any white spaces included in them.
If there are any white spaces included
in the field names, for example
from, as shown in the JSON data
shownbelow, the fields
namedApp Name and Product Category,
then the result will be:one might observe the error as Error rendering macro json-table: Space not allowed in path. Refer the screenshot attached.
Code Block [{"Tools":["Both"],"Role":["Support Engineer"],"Name":["K S"],"User":["test.user"],"App Name":["Bobswift"],"Product Category":["BI reporting"]}]
- 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 are as shown below
- Save the settings and Publish the page.