For better comprehension, It's recommended to consult in conjunction with this documentation, the demo application. It can be installed when installing the component.
Table of contents
──────────────────────────────────────────────────────────────────
1. Before starting
1.1.Install the last version of the component
1.2.Create a component dependency
2. Pretty format a JSON
2.1. Drag and drop the imported Web Block
2.2. Fill in the Web Block parameters
2.3. Create a screen action
2.4. Refresh the Web Block
2.5. Trigger the pretty format action
1.1. Install the last version of the component
Consult the JSON Pretty Format component in the OutSystems Forge and verify if the last version of the component is installed in your environment. If not, install it. This component also requires the installation of the InjectHTML component. At this moment, the demo application can also be downloaded and installed.
1.2. Create a component dependency
In the desired module that should include the pretty formatted JSON, open the 'Manage Dependencies...' option (1), search for 'JSONPrettyFormatReactive' (2) and import the 'JSONPrettyFormat' Block (3). Apply your changes.
2.1. Drag and drop the imported Block
In the screen element that should display the pretty formatted JSON, such as a 'Container', drag and drop the imported 'JSONPrettyFormat' Block. It is located under the 'JSONPrettyFormatReactive' Reference, in the 'Interface' tab.
The ‘JSONPrettyFormat’ parameters must be filled in. The ‘OriginalJSON’ is the unique mandatory parameter. Consult the parameter details below.
The JSON to be Pretty Formatted
Defines if the pretty formatted JSON starts collapsed instead of expanded.
Defines if the JSON root node can be collapsed.
Defines if the JSON children nodes can be collapsed.
Defines if the URL's can be clickable.
Defines if the JSON keys are displayed with double quotes.