In some cases, you may wish to read a configuration file exported from the Lightning Conductor, Lightning Data Viewer, or Lightning Forms. These export files are written in JSON.
What is JSON?
JSON stands for JavaScript Object Notation. It's a way to represent a data structure by using key-value pairs to store and exchange information. JSON “code” is made up of Objects { } and Arrays [ ]. For example, the following JSON fragment might describe a specific “car” object.
"car": {"make":"MINI", "year":"2016", "color":"cream", "features":["manual transmission", "hatchback"]}
In this example, make, year, color, and features are properties of the Object called car (enclosed in curly brackets). Each property has a key (such as the word make) and a value (such as MINI). In the case of the features property, there can be multiple features, so those values are presented as an Array, enclosed in square brackets.
Format a JSON file
If you open the .json or .data file in Notepad, it will be in one long line, which is difficult to interpret when it's a large file with many objects. Following are two ways to make the file easier to read. Lightning Tools Customer Success Team members can assist with interpreting the files, if needed.
Pass the file to an online JSON formatter
You can copy paste the full file contents into a free online formatter such as JSON Formatter & Validator. With this tool, you drag your file into the empty box and click Process. The formatted text appears in the box below.
Use Notepad++
Another method is to open the file in a feature-rich editor such as Notepad++ (free) with a JSON formatter plugin. In Notepad++, you can install plugins via the Plugin Manager:
The JSON Viewer plugin is one that works well.