Deleting items from Data Jar

I’m having some trouble sorting out the syntax for deleting items from Data Jar. The basic use case is that I’d like to randomly sample items from a dictionary without replacement.

Here’s an example Shortcut of what I have in mind. It creates a dictionary with three values, randomly samples one, and then deletes the item. This last step is the one I can’t sort out.

Any suggestions are really appreciated.

Thanks,
Matt

Does this example help?

Note that this is based on creating and then a dictionary and then subsequently removing a value from that dictionary;, as per the request. But I also want to acknowledge that the example shortcut seemed to be working with a list, and not a dictionary.

Thanks @sylumer!

Sorry for my sloppy terminology. I did write dictionary, but meant list. In the example you provided, how would you proceed if you didn’t know in advance that you wanted to delete “bar”? What I’d like to do is randomly pick one of the three values in tempX and then delete it.

What I’m actually trying to do is set up a series of meetings with my team in random order. I have everyone’s name (and other details) in AirTable. I pull the table down into a list in Data Jar, randomly pick someone, send the name to Fantastical for creating an event, and then repeat with someone else. All of this works fine, except that one individual can be chosen multiple times. Deleting them from the Data Jar list would prevent this.

Why not just read a list from Data Jar each time, randomly order the list and then generate all the calendar entries? The data sounds like it would be consistent, with you only wanting to vary the order each time.

That’s great! Thanks @sylumer. I didn’t know that there was a random order option in the Filter action and certainly wouldn’t have looked in the Files group for it.

Files filters work with a surprising number of things that are not files, and discovery by accident is certainly unlikely. Back when the app was Workflow and the devs were not under the Apple cone of silence, there was a lot more discussion about the utility hidden in those file actions :wink:

1 Like