Used in this video
CopyDoc
コピー
Everything you need to easily export, import, localize and update text in your Figma designs.
Try CopyDocGet started today
Video Transcript
Today I'm going to be showing you how to import and export text content from Figma using JSON files, and we're going to do this by installing a Figma plugin called "CopyDoc".
If you haven't already done so, you can go to the Figma Community and search for the term "CopyDoc", and you'll see a result called "CopyDoc" come up under the "Plugins" tab and if you go to the right hand side, you'll be able to click on the "Install" button, and once it says "Installed", you can jump back into your Figma file and we can get started.
The first thing we need to do is just right click anywhere, go down to "Plugins", and then click on "CopyDoc", and that's just going to open the Figma plugin that we just installed. You'll notice that there's a few different options here, but today we're just going to be looking at the options which export Figma text layers to JSON and then import the text updates to Figma from that modified JSON file. In order to edit the content, we first need to export the JSON file from Figma, and we can do that by clicking on the "Export JSON" button on the right hand side here. Once that loads up, you'll see that all of our parent frames, all of the frames at the top level of the page will be loaded into the Figma plugin as an option to choose which frames you actually want to export the Figma text content from.
By default, it will automatically pre-select all of the frames, but you can easily change that by either deselecting the frames that you don't want, or deselecting all the frames and checking a couple. The other way that you can do it really easily is just by selecting all the frames, and then clicking on the frames individually; by highlighting those frames, the Figma plugin will automatically filter down just the frames that you've selected on the Figma canvas, so that's just another really quick way if you know which frames you want to export and not have to go through the list and find the check boxes.
For today's example, I'm just going to export every single frame and this is just to show you what it looks like with a medium sized JSON file from Figma. To export our Figma text content to JSON, we can just click on this top right button over here, which is "Export JSON"; I'm going to click that now and this is going to export all of the text content currently on our page to a JSON file. Now that the Figma text layers are ready to download, I'm going to click on the "Download Text" button, and I'm going to save the zip file to my desktop.
If I double click on the zip file and open up the folder, you'll see that we've got our JSON file that's been saved out, and we also have a folder called "frames", and that "frames" folder has been included because I opted-in to the "Include Design References" checkbox that was in the Figma plugin a moment ago. If I look at those images, the Figma plugin is basically saved out PNG files of every single frame that I decided to export, and this is just a really nice way to have a visual reference of the text content in the JSON file that we've just exported, even if you don't directly have access to the Figma file at the time. These are just a really nice little bundle of exports that you can reference while you're making copy updates.
Now that we've got our JSON file, let's go ahead and open it up in our code editor. I'm going to use Visual Studio Code and open that up now; I'm just going to drag the JSON file into the Visual Studio Code editor, and you can see here we've just loaded in our JSON file. This is the Dieter Rams presentation page JSON file; this is all of the text content that's currently in our Figma file that we've exported to JSON using the Figma plugin. You can see here we've got an array of JSON objects, and each object has an "id", the "frame" name, and also the "text" string.
The "id" is a field that you definitely don't want to touch, that's what helps map the content back into Figma when we re-import the JSON file in a moment; I'll show you what that looks like very shortly. The "frame" is just a reference to the frame that's being included for each of those different text layers; that's essentially the parent frame for all of these little text strings, you can see here it changes as we go along, and the frame can also be used as the reference as I showed you a minute ago in the frames folder. If you really wanted to visually reference what was in "Frame 4" or "Principle 3", you could just go into the "frames" folder, find number "4" and open that up, and we can see here that the text content will match up with that, so that's what that looks like there.
Okay, so now that we've got our JSON file with all of our Figma text content, I'm just going to make a few updates to show you what it looks like to then re-import the JSON file to Figma. For example, if I were to change "Dieter Rams" to my own name in this instance, and then I changed "Ten principles" to "Two principles" for some reason, and then if I decided to do a bit of a bulk replace as well I could do that, too. If I did a search for "good design", and I did a find and replace, I can replace "good design" with "bad design". That's just a bit of an update across the board, so if I click on "Replace All", that has now changed every reference of "good design" to now be "bad design".
That's all I'm going to do for now, and I'm just going to save that JSON file again. Now that I've saved the JSON file, we can go ahead and re-import that text content back into Figma from JSON. I'm just going to minimize the file, and in my Figma plugin, I'm just going to close off the success message; and this time instead of clicking on the "Export Figma text layers to JSON" I'm going to use the "Import text updates to Figma from JSON" option.
If you go ahead and click on the "Import JSON", button that's going to bring up this little prompt with a box that you can either click or drag and drop a JSON file inside. In my case, I'm just going to drag and drop the updated JSON file that we just edited directly into that little box, and drop it; and there we go, it has just read all of the text content from that JSON file, and you can see here it's detected 13 Figma text layers that contain text updates. On the left hand side, we've got all of the current Figma text that's in the document, so you can see here "Dieter Rams" crossed out and then it's going to replace it with my name, and it's worth noting that none of these text updates have been applied yet; the Figma plugin will always allow you to review and approve any of the text changes that are going to be included and, so you can actually opt-out of any that you don't like. For example, if I uncheck the bottom layer and I don't include that one, it's only going to actually include 12 out of those 13 changes.
If you want to verify where those are actually coming from, you can easily click on this little magnifying glass icon and that will instantly zoom in to exactly where that text located on your Figma page. That's just a really easy way to validate where the text is going to be updated before you decide to approve it, and you'll see here as well there's a visual diff checker at every stage. For each row that's been detected in the JSON file, you can see here exactly what's going to change, so instead of the word "good", the "d" is being kept, but the first letters are being replaced with "b" and "a" to make it into "bad design". That's a really easy visual cue to get a sense of exactly what's going to change again before you decide to override those text layers in your Figma document.
Now that I'm happy with all those, I'm going to click on the "Update Figma Text Layers" button, and I'm just going to zoom out so you can see it happen in in one go. If I zoom out, and I tell CopyDoc that I want to update those layers, all I need to do now is click on the "Update Figma Text Layers" button. I'm going to do that now, and you'll see here that it's just updated 12 Figma text layers with the content from our JSON file. If you have a look on the actual Figma canvas itself, you can see that we've got "good design" being replaced with "bad design" all over the place. Even though we've updated the content as you can see here, it's changed the icons to show little check marks, and it's got a little "Updated" in brackets on the side here. You'll notice that the one that we didn't select is now disabled, and it hasn't been updated; this is just confirming that those layers have been updated, and you can still click on these icons if you want to manually verify what has been changed and what it looks like.
It's very simple, and if you accidentally made a mistake, you don't have to worry; you can just use the shortcut for the undo button, so if you're on Mac you can use "CMD + Z" or Windows you can use "CTRL + Z", and if I do that now you can see that all of those text changes have just been undone. That's just a really quick way of undoing all the changes if you accidentally approve something by mistake.
If you want to re-import it, you can just click on the "Import JSON" button one more time, and I'm just going to drag that JSON file right back in and load those Figma text layers up again, and you can see this time again it's just coming up with 13 out of 13. I'm just going to approve all of them this time, and I'm going to click on the "Update Figma Text Layers" button one more time. You can see what it looks like, so if I click that, it's just updated 13 Figma text layers in about one second. You can see all of the changes have been made as we'd expect, so that's just an example of how you can really quickly export all of your Figma text content to a JSON file, edit it using a text editor or a code editor, and then re-import all of that updated text content back into your Figma designs in a matter of seconds.
It's a very quick way of updating content in bulk, and if you're if you're working with a team of developers who prefer to use a JSON format, there's some really neat things that they can do with JSON data. If you are working with the development team just get in touch with them and see what they might be able to do with making really quick edits to those JSON files; they may be able to pull content down from an API or do something really interesting to update that content, or even just use the JSON content for a completely different purpose; they may be able to integrate that content with a Content Management System (CMS), they may be able to integrate that Figma text into a third-party API or something like that; there's a whole bunch of neat things that you could do with a JSON file after you've exported it from Figma.
For the purposes of managing copy or managing text from Figma using a JSON file, you've just seen the simplest version of it; you can simply just open up the JSON file that the Figma plugin exports, update all the text layers that you need using your code editor or text editor, and save that for re-importing into Figma from that updated JSON file. If you've been wondering how to use JSON files to manage your Figma text content, then I hope this Figma tutorial has been helpful for you. Thank you as always for watching, and we'll be back soon with more Figma tutorials just like this one very soon.
Adam Brock
Founder of Hypermatic
The secret weapons used
in high performing teams.
World-class teams of designers, developers and copywriters use our Figma plugins to 1,000x their daily workflows.
TinyImage
タイニー
Export compressed JPG, PNG, SVG, WebP, AVIF, GIF and PDF files from Figma, reducing sizes by up to 95%.
Try TinyImageGet started today
Pitchdeck
ピッチ
Magically turn your Figma designs into animated presentable slide decks, or export them to PowerPoint.
Try PitchdeckGet started today
Convertify
コンバート
Export Figma to Sketch, XD, After Effects or Import XD, Illustrator, Google Docs, PDF to Figma.
Try ConvertifyGet started today
Emailify
メール
Easily create and export responsive, production ready HTML emails (eDMs) from Figma.
Try EmailifyGet started today
CopyDoc
コピー
Everything you need to easily export, import, localize and update text in your Figma designs.
Try CopyDocGet started today
Bannerify
バナー
Animate and export production ready banners from Figma to HTML, GIFs and Videos, in seconds.
Try BannerifyGet started today
Crypto
ロック
Securely share your Figma designs and prototypes as password protected URLs or PDF files.
Try CryptoGet started today
Favvy
ファビー
Export production ready favicons (with code) for your website or PWA from Figma in seconds.
Try FavvyGet started today
Pixelay
ピクセル
Compare and visually QA your Figma designs against real website URLs using smart overlays.
Try PixelayGet started today
HyperCrop
クロッパー
Batch crop/resize multiple images into multiple sizes with presets, smart cropping and face detection.
Try HyperCropGet started today
Commentful
コメントフル
Supercharge your Figma comments and gather external feedback from stakeholders.
Try CommentfulGet started today
Weblify (Beta)
サイト
Inspect your Figma layers as clean HTML, Tailwind, React or Vue code in one click.
Try WeblifyGet started today