How to Enter and Manage Dictionary on iOS Shortcuts
Fortunately, we can import JSON-formatted text as a dictionary on Shortcuts. There are also more options available when it comes to JSON editors and tools; that’s another advantage over working solely on Shortcuts’ GUI-style dictionary.
- Create a text where, much like Shortcuts’ Dictionary format, follow the JSON syntax. For example, this is how text-based (string) keys and values are entered:
{"key": "value"}
- On the shortcut in question, copy the JSON text over in a Text variable.
- Add a “Get Dictionary from Input” action, and use the text variable as input.
To illustrate the potential uses, I have a shortcut made to populate backup schedules of different devices. If I were to manage them directly on the Shortcuts app through dictionary variable, I have to add key-value pair per device with its schedule. But with the import method, not only I can work with keyboards to type it all out, I can potentially copy-paste a similar schedule into a JSON.
It’s also possible to save the the text file on Data Jar, an app I have covered on App-to post. Once stored in the Data Jar, you can save and synchronize the dictionary variable for the future use. It is possible to achieve the same without the app, but I highly recommend it for its accessibility. Data Jar’s dictionary UI is nearly identical to that of Shortcuts, so I highly recommend saving it as a text file as well.