I believe your JSON would look something like:

var Types = {
    NormalHR: {
        Reinforcement: 0,
        Weight: 100,
        Message: 'Great! Your heart rate is in the zone.',
        EnforcementSound: 'ding'
    },
    HighHR: {
        Reinforcement: 1,
        Weight: 100,
        Message: 'Slow down. Your heart rate is too high!'
    },
    LowHR: {
        Reinforcement: -1,
        Weight: 100,
        Message: 'Speed up. Low heart rate.'
    }
};

As @Balder says in their answer, you can then access use dictionary-style syntax, like:

  • Types['NormalHR']['Reinforcement']

You could also use property-accessor syntax, like:

  • Types.NormalHR.Reinforcement

The reason I didn't include the "type" of each item, is that you can easily infer it for building your grid - as follows:

  • typeof Types.NormalHR.Reinforcement (this will return "number")
  • typeof Types.NormalHR.Message (this will return "string")

Similarly, to get the counts - you can count the properties of a specific object. In modern browsers, try:

  • Object.keys(Types.NormalHR).length (this will return 2)

For older browsers, refer to other methods here: How to efficiently count the number of keys/properties of an object in JavaScript?

Hope this helps!

Answer from Troy Alford on Stack Overflow
๐ŸŒ
Heardlibrary
heardlibrary.github.io โ€บ digital-scholarship โ€บ script โ€บ python โ€บ json
Dictionaries and JSON | Digital Education Resources - Vanderbilt Libraries Digital Lab
In this example, we applied the json.loads() function directly to the multi-line string and immediately assigned it to a variable. Since the outer layer is the list, the first square bracket has a numeric index. Since the value of item 1 in the list is a nested dictionary, we write the key for the value we want in the second square bracket.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ convert-json-to-dictionary-in-python
Convert JSON to dictionary in Python - GeeksforGeeks
July 12, 2025 - Create a json string and store it in a variable 'json_string' after that we will convert the json string into dictionary by passing 'json_string' into json.loads() as argument and store the converted dictionary in 'json_dict'.
Discussions

JSON / Dictionary Action Examples
So JSON in Shortcuts can be retrieved from Dot notation. For Eg. data.1 = A is same as {"data":[A,2]} https://www.icloud.com/shortcuts/a765ffd73c4345398fe9effb7fccedb1 More on reddit.com
๐ŸŒ r/shortcuts
9
10
June 15, 2021
JSON Effectively is a Dictionary? Change My Mind
Itโ€™s essentially a mix of dictionaries and lists. A JSON object is similar to a dictionary, and a JSON array is similar to a list. Pretty much any JSON data structure can be translated into a complex Python data object. More on reddit.com
๐ŸŒ r/learnpython
7
0
December 17, 2022
JSON and Dictionary
The core of your answer is correct: JSON is some string representation of data dicts are objects in memory But your explanations are geting away from these facts. 1. Comparing notation dicts are not strings! You say that dicts are represented by "curly braces" . So you are comparing json with dict representation, not dicts themselves. my_dict = dict('name' = 'eagle221b', 'platform' = 'reddit') This is another representation of dicts, that does not look like JSOn at all. Also you are saying "curly braces"in JSON are objects. No they are representations of objects. This makes a great difference when working with them. 2. the power of dicts So let me create another example again: my_list = [] my_dict1 = {'my_list': my_list} my_dict2 = {'my_list': my_list} my_list.append('foo') The last command has not changed any of the dicts, but if you print them, you will see the representation has changed. Also about the values: you can store objects or even functions in them. A value in dicts is just a memory pointer. (and yes, any number in python is an object) Conclusion They both are completly different things that both are based on a key value principle. But one is a text, one is memory and therefore very different. More on reddit.com
๐ŸŒ r/Python
49
250
October 10, 2020
Dictionary in JSON format
Of course - you can store any level of complexity of data in JSON (to a point of course) - example from one of my projects: https://github.com/joeavanzato/RetrievIR/blob/main/configs/antivirus.json EDIT: Are you asking for literal 'dictionary' data like word definitions? I assumed you were just asking for examples of more complex JSON data. More on reddit.com
๐ŸŒ r/learnprogramming
2
2
May 21, 2024
๐ŸŒ
Reddit
reddit.com โ€บ r/shortcuts โ€บ json / dictionary action examples
r/shortcuts on Reddit: JSON / Dictionary Action Examples
June 15, 2021 -

Shortcuts located here: Building/Using Dictionaries:

https://www.icloud.com/shortcuts/3e5a3524dc0e434cba55549f123605b4

Building Nested Dictionary Values:

https://www.icloud.com/shortcuts/ff1b76d0e41f47cb8cdfa0754edfbc0d

I wanted to share two shortcuts that I created as sort of a memory reference for future Shortcuts that I might create that utilize Dictionary Actions. This work is based on knowledge that I gained from Shortcut Masters on Reddit like gluebyte, mvan231, and others. My thanks to them!

These Shortcuts are meant to be inspected and run in the Shortcut development mode i.e, from within the Shortcuts app, opened for editing so that the comments can be reviewed.

These Shortcuts are designed as a tutorial of sorts for beginners who may be struggling with how to use Dictionary Actions and how JSON formatted strings can be created and used.

The first Shortcut, titled โ€œBuilding/Using Dictionariesโ€ builds a simple โ€œKey/Valueโ€ pair Dictionary and demonstrates some methods for adding Key/Value pairs, as well as some examples of user interaction with a Dictionary object.

The second Shortcut, titled โ€œBuilding Nested Dictionary Valuesโ€ demonstrates a method for creating more complex โ€œNestedโ€ JSON strings by using a โ€œTemporaryโ€ Dictionary Action to build partial JSON Key/Value pairs that can then be appended to โ€œFirst Levelโ€ Keys in a Dictionary.

Finally, although Iโ€™m not new to programming in general, I have only been working with Shortcuts for about a week, and fully expect a reply from some Reddit user, (perhaps one of the โ€œMastersโ€), saying, โ€œOk, but thereโ€™s a lot easier way to do this or thatโ€, and then provide me an example. In the meantime, maybe these Shortcuts can provide some guidance to beginners that wish to utilize the very handy Dictionary Actions in Shortcuts.

๐ŸŒ
Apple
support.apple.com โ€บ en-is โ€บ guide โ€บ shortcuts-mac โ€บ apd0f2e057df โ€บ mac
Intro to using JSON in Shortcuts on Mac - Apple Support (IS)
A dictionary is an unordered collection of values that each have a unique key, together called key/value pairs. In JSON, they look like {key1: value1, key2: value2, key3: value3}, and so on.
๐ŸŒ
USNA
usna.edu โ€บ Users โ€บ cs โ€บ nchamber โ€บ courses โ€บ forall โ€บ s20 โ€บ lec โ€บ l25 โ€บ index.html
SI286: JSON Data Format
Take a look at this bigger example. This is data that was returned from querying an online database for baseball stats. The first part of the JSON string is a "queryResults" key in the dictionary. You can see it then contains a a 'created' time and a 'totalSize' -- which is how many results ...
Find elsewhere
๐ŸŒ
Medium
medium.com โ€บ analytics-vidhya โ€บ python-dictionary-and-json-a-comprehensive-guide-ceed58a3e2ed
Python Dictionary and JSON โ€” A Comprehensive Guide | by Kiprono Elijah | Analytics Vidhya | Medium
January 11, 2024 - Python dictionary is a a collection of key-value pairs. Dictionary is mutable(can be changed), unordered and can be indexed. JSON is a data format...
๐ŸŒ
Codingnetworker
codingnetworker.com โ€บ 2015 โ€บ 10 โ€บ python-dictionaries-json-crash-course
python dictionaries and JSON (crash course) - Coding Networker Blog
October 19, 2015 - You can use the dumps() function to create a JSON formatted string from a dictionary, like in the following example:
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ how-to-convert-python-dictionary-to-json
How To Convert Python Dictionary To JSON? - GeeksforGeeks
March 26, 2025 - For example, if we have a dictionary d = {"name": "Tom", "age": 10, "city": "Paris"}, converting it to JSON will represent the data as {"name": "Tom", "age": 10, "city": "Paris"}. Although both look the same, if we check the type of the JSON ...
๐ŸŒ
Newtonsoft
newtonsoft.com โ€บ json โ€บ help โ€บ html โ€บ serializedictionary.htm
Serialize a Dictionary
Dictionary<string, int> points = new Dictionary<string, int> { { "James", 9001 }, { "Jo", 3474 }, { "Jess", 11926 } }; string json = JsonConvert.SerializeObject(points, Formatting.Indented); Console.WriteLine(json); // { // "James": 9001, // "Jo": 3474, // "Jess": 11926 // }
๐ŸŒ
Dictionaryapi
dictionaryapi.com โ€บ products โ€บ json
JSON Documentation
Further sections cover data elements unique to the Advanced English Learner's Dictionary, Elementary Dictionary, Medical Dictionary, and Spanish-English Dictionary. In each major section, an "Example" subsection provides a JSON sample. To aid developers transitioning from our XML format to JSON, this is followed by an "XML Equivalent" subsection showing the XML markup matching the JSON code.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ difference-between-json-and-dictionary-in-python
Difference between Json and Dictionary in Python - GeeksforGeeks
July 23, 2025 - Python JSON holds data in the form ... a Python dictionary. However, in this case, the JSON key is a string object with a mandatory double quotation mark. The value corresponding to the key, on the other hand, could be of any data type, such as string, integer, nested JSON, or any other sequence data type equivalent to an array. In this example, a JSON string ...
๐ŸŒ
Index.dev
index.dev โ€บ blog โ€บ convert-json-to-dictionary-python
How to Convert JSON to a Python Dictionary: Step-by-Step Guide
In this example, the custom_decoder() method turns the age field to an integer, even though it was supplied as a string in the JSON. This guarantees that the data types in the resultant dictionary are exactly what you need.
๐ŸŒ
Quora
quora.com โ€บ What-is-the-difference-between-JSON-and-a-dictionary
What is the difference between JSON and a dictionary? - Quora
Answer (1 of 6): JSON is a universal (language independent) string-based storage and delivery format that uses a system of nested key/value pairs to encode data. A dictionary (in some languages, including Python) is a data structure that also uses nested key/value pairs. Because they both use key...
๐ŸŒ
Reddit
reddit.com โ€บ r/python โ€บ json and dictionary
r/Python on Reddit: JSON and Dictionary
October 10, 2020 -

Once in an interview I was asked the difference between JSON and Dictionary. So I decided to write a blog post about it. Do check it out. Link

๐ŸŒ
Reddit
reddit.com โ€บ r/learnprogramming โ€บ dictionary in json format
r/learnprogramming on Reddit: Dictionary in JSON format
May 21, 2024 -

https://raw.githubusercontent.com/matthewreagan/WebstersEnglishDictionary/master/dictionary_alpha_arrays.json

I found JSON files containing dictionary data, but often the data isn't organized into arrays and objects. You want to have an object indicating the type of word, the definition and other information, but often times the JSON you see on Github are just a simple one-to-one mapping. Is there any better more informative and structured dictionary JSON files out there?