Am I Missing Something Obvious with Lists in Shortcuts?

Forgive me if this is obvious but after Googling, I can’t find an answer to something that seems like it would be trivial in Shortcuts. Clearly, I’m no ninja (yet)

I have a bunch of thirteen digit numbers, all return separated, on my clipboard.

For each line, I want to put that number into each of several structured URLs that need this number, so I’d be both prepending and appending text around it.

I think I want to put all items on the clipboard into a list, then loop through them. Sound right?

But…

For the life of me, I can figure out how to automate populating the list in Shortcuts.

It seems like putting a return separated block of text into a list would be useful often for other projects too.

What am I missing?

THANKS!!!

You can’t really modify a list action when the shortcut runs.

What you would want to / need to do is use the get clipboard action, followed by a split text action. Use the split text action set to split text by new lines.

Now you will have a list of the items you want to iterate through and can use a repeat with each action. Inside of it, use a url action to build your desired URL and then proceed accordingly

Shortcuts

2 Likes

This is exactly what I needed. Thank you very much for pointing me in the right direction!! And forgive the delayed reply. I need to turn on email notifications. Thanks again!

1 Like