No way to remove items from existing list?

Just playing around, I created a shortcut to create a list representing a deck of cards:

I was thinking I could then shuffle it by repeatedly (52 times to be exact) taking a random item from the list, adding it to a new temporary list, and deleting it from the original. But unless I’m mistaken it appears there’s no way to delete from and existing list.

You’d have to check if you already have the item, or you’d have to use something like Scriptable

Correct to my knowledge as well.

In the past when I’ve had to tackle more ‘traditional’ programming tasks like that I’ve used Drafts (4) actions and a bit of Javascript (or sometimes Pythonista). These days, I’d almost always opt for Scriptable, as @lbutlr suggests above.

However, for this particular case, assuming you have an Internet connection you can do a good random shuffle with a quick web call. Here’s an example I had for shuffling cards that I originally wrote for Workflow that uses a call out to

1 Like

Oh, that’s clever! I wouldn’t have thought of that.

Very clever.

Yes, I agree this is probably better handled in a more conventional and powerful programming language. I was really just messing around & discovered this issue. It seems lists are really designed primarily for user interactions, & they don’t have the methods you’d expect with a more general purpose list object.

For simple lists where the values are not some sort of complex objects, you can use the Filter Files action and set the filter to Name is not value-to-remove.


Wow that works on a preliminary try…apparently one consequence of the flexible data typing in shortcuts is that a “file” function works on objects that never have been and never will be files.