As I was learning about KM Dictionaries there were a couple important points I discovered:
Dictionaries persist unless all keys are set to null.- Dictionaries persist unless all keys are set to null --OR-- until the JSON is set to {}. (This much simpler method was shared below by @Zabobon.)
- Unlike Global Variables, they cannot be viewed using the KM Preference. Fortunately, however, @DanThomas has created and shared a macro tool that can view both: MACRO: Variable Inspector Prompt and Dictionary Editor v2.0.2
Here's a utility macro I created and used while I was learning about KM dictionaries. It's very basic but includes examples of these dictionary functions:
- Add/Update a Key
- View All Keys
- View Two Specific Keys
- Delete Dictionary By Setting All Keys to null
- Delete Dictionary By Setting JSON {} [much simpler method]*
* added after receiving the feedback below from @Zabobon
DOWNLOAD Macro File:
Dictionary Functions-jsDDPL_dict.kmmacros (24 KB)
Note: This macro was uploaded in a DISABLED state. It must be ENABLED before it can be run. If it does not trigger, the macro group might also need to be ENABLED.