Quick Tip: Data-Driven Graphics Using Illustrator’s Variables Panel
videos

Quick Tip: Data-Driven Graphics Using Illustrator’s Variables Panel

Tutorial Details
  • Version: Illustrator CS
  • Level: Advanced
  • Length: 3:59

Illustrator’s Variables panel lets you create data-driven graphics in a fraction of the time it would take to do them by hand. In this Quick Tip, learn about Variables and see how to create and save 100 different business cards in under two minutes.

You can download the variables which accompany this tutorial here.

  • http://www.astutegraphics.com Nick

    Wonderful Cheryl – never seen this explained so clearly before! Thanks.

  • http://vectorboom.com/ Iaroslav Lazunov

    Wow, It’s a great tut, Cheryl! Thank you.

  • Jim K.

    Superb! Thank you Cheryl.

  • http://www.ilieciorba.com Ilie

    Wow, just wow.

  • http://www.graphicgeoff.com Geoff

    This could be one of the most useful tutorials I’ve ever seen. I didn’t even know there was a Variables panel!

  • Robert Smith

    Very useful. Thanks!

  • Danny

    This is very useful Cheryl. I’m having a little problem though.
    I used Excel2004 for MAC to create the XML data, and I keep getting a “incoming variable library is invalid” error when trying to load my XML file. What program did you use to generate xml file?

    • Cheryl

      Hi Danny – Yeah, I kept having that problem, and I don’t know enough about XML to know why exactly that happens. I’ve used Excel to output the XML before, with no trouble, but that was a few years ago, so I don’t know if it’s an issue of compatibility between versions.

      What I ended up doing, as demonstrated in the video, is to create a simple XML file from Illustrator. I then handed that off to a friend who used it as a template to output the XML file from my data. I do know that all of the fields have to match up, so if you have 5 columns in Excel, you need five matching variables in Illustrator. You might also try to check the headers and footers of the XML file in a text editor and make sure all the correct tags are there.

      So, save your XML file from Illustrator, then open it side-by-side with the one you created from Excel and see if you can spot any discrepancies. Wish I could be more help. but I’m an Illustrator, not a programmer :)

  • Sauro

    Glad to see that this is on Illustrator too, but I usually use to do it with InDesign that had this tool already …

  • http://kishkoosh.com Ron

    Wow! This is great. Very useful!

  • http://vectorboom.com/ Iaroslav Lazunov

    Cheryl, What application do you use for creating and editing xml files?

    • Cheryl

      Iaroslav – I created the XML template in Illustrator, then handed it off to a programmer friend. I assume he used some kind of script to populate the template – I’ll ask.

  • http://www.jonathanpatterson.com Jonathan Patterson

    Automation tips are always good to pick up. Great post!

  • Phil

    Hi all – I’m Cheryl’s “programmer friend” (the programmer bit is admittedly an overstatement these days…I am more of a data janitor and admin ubergeek who just happens to find the good old trusty shell tools to be indispensable for so many of my daily tasks).

    I’ve sent along a zip file to her containing the script I banged together to do this example, along with the example data. The script relies mostly on awk, a venerable language which has been around the UNIX world since the ’70s and still comes in handy for parsing and manipulating text files. Mac (and Linux) users can run this in a terminal session without needing anything else. Windows folk will need to install either cygwin (http://www.cygwin.com/) or a combination of win-bash (http://sourceforge.net/projects/win-bash/) and unixutils (http://unxutils.sourceforge.net/) to use it.

    It may look and sound a little daunting, but if you need to take apart and reassemble large files and automate tasks for projects such as this example, the time invested in setting up a quick script like this can pay off very nicely — especially if you need to handle thousands of objects.

  • http://www.fyles.com/ Dan Fyles

    Awesome top tips Cheryl. Really clearly explained, thank you.

  • David

    Thank you Cheryl for this good exemple. I’m using indesign for that, but it’s realy interesting to know how to do that wxith illustrator (my main program)

    And thanks for the “programmer friend” :D

    • Cheryl

      “Programmer friends” are good to have ;)

  • Dougieladd

    Hi Cheryl… this is a great tutorial from you (as usual)… However I thought it might be worth mentioning that when you try this technique with Linked Images Illustrator CS5 may crash. This is because there is an error on adobe’s part and they have provided a patch to fix the problem. It’s called Adobe® Illustrator® 15.0.1 update and It is available on the Adobe website. Thought I’d mention it just in case others get frustrated (like me) when the program crashes.

  • Gary

    “I’ve sent along a zip file to her containing the script I banged together to do this example”

    Any chance we could get a link to this?

    Thank you

    G.

    • http://chewedkandi.net Sharon Milne

      Hey Gary,

      I’m just chasing this up so I can give you a response on this one. Thank you for your patience :)

      Shar

  • Gary_D

    “I’ve sent along a zip file to her containing the script I banged together to do this example, along with the example data.”

    Would be great if we could this file(s) uploaded to the members area?

    Great tut btw:)

  • Gary_D

    Thanks Sharon that would be great

    Sorry for the repost!

  • Gary_D

    Sharon, any joy with the script?

    Thanks

    • http://chewedkandi.net Sharon Milne

      Hey Gary,

      I’ve got the script from Cheryl – I believe we’re in the process of uploading it. I’ll e-mail it to you :)

      • Jonathan

        Hi Sharon,

        I would love to get a copy of that script! Please :)

      • http://chewedkandi.net Sharon Milne

        Hey Jonathan,

        Sorry for the delay – I’ve now added the link to the file on the article :)

        Enjoy!

  • Jonathan

    Sharon, You are awesome!
    Thank you!

  • Michael

    Hi-

    Cheryl, thanks so much for this very useful tutorial.

    One question I can’t seem to find the answer to anywhere – any idea on what the maximum size xml file one can you use in this technique? I can successfully batch when I load a single variable library with about 100 datasets at one time but anything much larger than that in the same xml format gives me a “the incoming variable library is invalid” error. I have thousands I need to create. Any help would be most appreciated.

    Thanks,
    Michael

  • shetu

    Hey how do i change image file?

  • Lau

    Great tutorial. Can I export each sampleDataSet in diferents files?

  • http://www.facebook.com/leonard.m.reidy Leonard M. Reidy

    Thanks for the tutorial, Cheryl. I have taken some of your courses and I have never been disappointed. Always concise, informative, and most importantly for me, easy-to-understand. For anyone who got the “the incoming variable library is invalid” error, a common cause is a missing xml closing tag in the source file. In the example file ussenators.xml there is a missing tag and this causes it to fail (at least in my copy of CS6). If anyone is interested, I can upload the fixed version of the file, or, if you like Cheryl I can send it on to you or to some address at Envato. For anyone who comes across this issue in the future with their own files, try opening the offending file in a web browser, like Win7/Safari. It will report xml errors and they can be useful for tracking down the cause. Then you can edit the file in a text editor (preferably a code editor).

    • http://twitter.com/RevolutionCS Anon

      THIS^ going crazy trying to find out how she made that file. Most important part of this tutorial, just blew right over it! getting same error and I notices her files was named us_senators.XML

      • Guest

        Here is the file I use!

  • Wan

    This tutorial has just saved my fingers from typing almost 100 names.

  • pctechtv

    Is anybody else having the problem; When you select a linked image on the artboard you should have the option to ” Create a Linked File variable:
    Select a linked file and click the Make Object Dynamic button in the Variables panel.” That is right out of the Adobe Illustrator reference. When I select linke files the button to make object dynamic is greyed out.I see no other way to continue(CS6) also reading about similar problems in (CS5). Thanks. Yes this is a great tutorial by Cheryl! Thanks

    • http://profiles.google.com/protorob RoBerto Briceño

      You have to check that the image you’re selecting is already a linked file and not an embedded one.

  • http://joaofaraco.com.br João Faraco

    Hi Cheryl,

    I built a CSV – XML converter, and hosted it here for all to use: http://joaofaraco.com.br/converter/
    I actually took Shan Carter’s Mr Data Converter and added the Illustrator compatible XML conversion function to it.

    I haven’t worked on it enough to take care of linked images, visibility and graph data, but for that it’s really just a matter of opening the converted XML, changing the variable categories and traits, and using Find & Replace to get rid of the tags wherever the variables aren’t text.

    These are the categories and traits for each variable type:

    • Jedi

      Excellent work! Thank you!

    • http://www.robertobriceno.eu/ RoBerto Briceño

      Now, as you can see, the resulting files after the batch processing doesn’t have file extension.
      To quick-fix this you can use Adobe Bridge’s action “Batch Rename” just browse to your destination folder, select all the files you want to rename, right click > batch rename and from there everything is pretty self explanatory. Hope this helps.

  • http://profiles.google.com/protorob RoBerto Briceño

    Now it could be very very nice if someone takes the time to explain how to use that very useful script :-)

  • dinesh

    when i have attached the .xml file in with load variable library & show the error is the incomming variable library is invalid. please help on this. how to proceed variable data form excel sheet in AI..

  • http://twitter.com/kemie kemie

    First of all, thanks, Cheryl, for saving me a ton of work and explaining this so clearly!

    Second, I had the hardest time formatting the XML. I did not have any “developer friend” to do it for me! :( So I thought I’d share some resources I found useful.

    I tried Joao’s csv to ai xml converter. seems to work like a charm- unfortunately I kept getting an invalid library error. Could never figure out why, but it might work for others.

    In the end I ended up using a script where you paste your comma or tab separated values into an illustrator text box and they are automatically added to your variables library. That one worked!

    https://github.com/nvkelso/illustrator-scripts/blob/master/other-authors/james_talmage/JET_TextScripts/JET_VariablesFTROU.jsx

  • Maquie

    I am getting an error when I try to import the ussenators.xml file. I am on a Mac running CS5. Any thoughts?