Duplicate and randomize your own custom Sketch data

Josh Kim
Josh Kim
Mar 27, 2019 · 4 min read

A reader-made appendix to The Sketch Handbook by Christian Krammer

Image for post
Image for post
Let’s make random duplication work in 2019.

I hit a roadblock today as I was reading through The Sketch Handbook by Christian Krammer- the Craft plugin wasn’t randomizing my text or photo data when I used the duplicate feature. It also seems like many others have been experiencing this issue as well with the new version of Sketch, so here’s a quick and easy alternative for those reading the book in 2019.

Image for post
Image for post
Some complaints in the past month related to duplication issues.

Procuring your own custom data

In Christian Krammer’s original example from The Sketch Handbook he is populating fields using Craft’s text plugin with cities and countries for his Visit Austria app- but I’m Korean, and I want to make a Visit Korea app with dummy text that matches my context better.

I started by googling up a Wikipedia page quickly of all Korean cities. These were nicely packaged in an online tabled list.

Image for post
Image for post
Original table from wikipedia.

Two things that we can do from here. Either A) download a plugin that allows us to copy just the column or B) copy the entire table and paste it into Microsoft Word. Since I’m kind of lazy, I did option B.

Image for post
Image for post
Table pasted into Microsoft Word.

We want to save just the first column of information to use for our dummy data in Sketch. To do so, let’s do the following:

  1. Get rid of all the hyperlinks first by using CTRL + A (select all) followed by FN+COMMAND+SHIFT+F9 (remove hyperlinks).
  2. Select the column and copy it.
  3. Paste the column into any text editor and delete any extra lines. I personally like to use Brackets!
  4. Save the list as a text file and we’re ready to move to Sketch!
Image for post
Image for post
Column pasted into Brackets. Saving as a text file directly from Word gave me some problems, but Brackets/texteditors did the trick for me in making it work. Make sure to delete any spare lines. In this example, there is an extra line on 86, which I then removed.

Open up Sketch and use the shortcut CMD + , (open preferences). Go to the Data tab and click “Add Data.” You’ll be prompted to select a text file. Pick the one that we just created and make sure it is checked on selection!

Image for post
Image for post
Your custom text file will now appear!

Duplicate and randomize your data

We’re going to start with Christian Krammer’s example. Here we have a symbol with an rectangle with an image fill and some text fields that we will want to populate.

Image for post
Image for post
We want to duplicate and randomize a full list from this one symbol.

We’ll start by using Craft’s duplicate tool, which still works- but doesn’t randomize the outputs. You can alternatively just copy/paste or alt drag if you don’t have the Craft plugin.

Image for post
Image for post
I’ve set the count to 8 and the gutter to 8 pixels.
Image for post
Image for post
Duplicated cards, but no randomized custom content.

Once you have the generic cards spread out, let’s add randomized data using our custom text file we installed earlier. If you’ve set up your symbol correctly, all you have to do is click the little overlay icon and select your data set to populate.

Image for post
Image for post
I’ve prepared several custom data lists to populate my cards.
Image for post
Image for post
Use Unsplash and search for a photo that is relevant to your project!

And with that you now have custom randomized images and text without having to click through every single card!

Image for post
Image for post

This also works if you need custom text for foreign languages, which may prove useful to some designers.

Image for post
Image for post
From Wikipedia to Sketch!

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch

Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore

Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store