I am trying to create a Shortcut to grab 5 news headlines from the Yahoo US news RSS feed and read them to me as part of a “wake up” shortcut that will run when I stop my alarm using the new iOS 13 shortcuts automations.
I am able to create a dictionary for these 5 headlines using the “Repeat with Each” action and iterating through the list. A Quick Look action (screenshot below) verifies that the Dictionary is created in JSON and the key-value pairs are the index number (1 through 5) and the corresponding headline as the value for each.
So far so good!
The problem comes when I am trying to retrieve each value individually to insert it in a Text action that will be the “script” for my “newscast”. I want the Text action to read like so: “Today’s first story is [Dictionary Value #1]. Up next, [Dictionary Value #2]” and so on, all the way through headline 5.
For “Dictionary Value #1” in my example above (and I’ve inserted screenshots below, along with an iCloud link to my shortcut) I use a Magic Variable to grab the Repeat Results from the End Repeat marker. I set the type to Dictionary and, when prompted, insert the key number as “1”. If I run the shortcut, this works and the headline associated with key #1 is inserted just fine in my Text action. However, if I repeat this process, and add a second Magic Variable, grabbing key value “2”, in addition to key value “1” nothing is inserted for 2 (but #1 still does insert the value for Key #1))
So, I’m not sure what is going on here: The Dictionary clearly exists (the Quick Look proves this) but I seem to be limited to grabbing only 1 value in the Text action.
Any help or ideas here would be very much appreciated!
Link to Shortcut: https://www.icloud.com/shortcuts/697de43ad18144e5ade2648baab9209e