Just before the academic year began in late August, I found myself looking through the Shortcuts application to see whether I had any shortcuts I needed to update for the new term. I found that I was missing one: a shortcut for creating random groups of students for small group work.
I didn’t need to start from scratch; I’d created a version of the shortcut earlier in the year, and had even submitted it for Automation April over at MacStories. I was pleased that I’d figured out how to get it working with groups having an unequal number of participants — that took a while! Still, I wasn’t entirely satisfied with it, because it spit out a messy, hard-to-read JSON dictionary. I was after something cleaner.
What I ended up with was a shortcut that calls another shortcut. Since my previous shortcut worked, I kept it as it was, then called it inside a shortcut that could clean up the mess. Here’s what the results now look like after running the shortcut on an iPhone:
That’s much nicer to look at than JSON.
Here’s the original shortcut that creates the groups. I’ve added comments throughout so you can see what’s going on. As noted, this shortcut produces messy-looking JSON.
To clean things up, I had to add each dictionary item to a list, then sort that list. Here’s the link to the shortcut that does that: Create random groups (shared). Again, I’ve added comments to explain the process.
Note that both shortcuts require that Sindre Sorhus’s Actions app be installed on the device where they’re run. Actions is available for macOS, iOS, and iPadOS, so the shortcuts can be run on whatever device is most convenient.