I am working on creating calendar templates from a JSON object stored in a file in iCloud. So I created a Shortcut that can create a file and add a template:
This seems to work fine. It reads the file and shows a list of template names before it asks to add a new template.
The second Shortcut should read the file, create a list of the templates and present a list to choose from.
I started off with the same actions, reading the file and presenting the content. However, when I try to extract the keys from the dictionary, just like the first Shortcut I get a totally different content (ProfileName, Tiff and such). No matter what I do, I always get the same content from a dictionary.
UPDATE: after writing down this text I tried it again and now the first Shortcut presents the same problem.
I’ve restarted the iPad, but no difference.
So basically it looks like any dictionary action presents the content of what seems to be a fixed dictionary with file attributes.
This worked as I’d expected from reading it through. I didn’t get any file attribute details. It read in the root level JSON entry, which returned a data set or sub-dictionary if you like, of the elements.
I’m wondering if you are wanting something more like this for the second shortcut, where you choose which template, retrieve the data set (value) for that, and then enumerate those key value pairs.
I am working on creating calendar templates from a JSON object stored in a file in iCloud. So I created a Shortcut that can create a file and add a template:
This seems to work fine. It reads the file and shows a list of template names before it asks to add a new template.
The second Shortcut should read the file, create a list of the templates and present a list to choose from.
I started off with the same actions, reading the file and presenting the content. However, when I try to extract the keys from the dictionary, just like the first Shortcut I get a totally different content (ProfileName, Tiff and such). No matter what I do, I always get the same content from a dictionary.
UPDATE: after writing down this text I tried it again and now the first Shortcut presents the same problem.
I’ve restarted the iPad, but no difference.
I even tried to put the contents in a text action and get the keys from the that, but no luck.
Hi, I haven’t tried your shortcut yet, but I in the mean time I have tested the same shortcuts with a friend who also has an iPhone with 13.1.2. Like you he could confirm the shortcuts work as intended.
At the same time they present the odd behaviour on my iPhone and iPad both running 13.2 public beta.
I suspect I have run into a bug in 13.2.
I wonder if there is someone out there with 13.2 public beta on his/her iPhone or iPad who can confirm my findings.
For those interested: I am now on iPadOS 13.2 beta 3 and the problem still exists.
I have tested with a simple JSON text which works fine:
{ “key”: “value” }
However, when there is something wrong in the JSON (like smart quotes in the example above) it presents the same problem.
So far I have found that smart quotes and a backslash in the JSON cause it to be read wrong.
And I finally found the problem: there was an invisible character, possibly a tab in my JSON. When I replaced it with something else, it worked.