Moving or copying variables from one library to another

Exactly what I needed! Worked perfectly.

Thanks @Bencko_Jan & @Hal_Lee.

Quick question as I do not only want to copy and paste variables between files, It is super important for me that all linked variables in all files will stay synced with the variables. Not to create another copy of them.
Is this something that your plugin can do? Then I would love to try it out. But as I am working on a library connected to tons of files, I have to be very careful.

1 Like

Maybe just create a new Design system containing the variables you need and connect that design system to the files where you need to need to use the variables.

@Oliver_Schwaiger ^

Thought about that already if you mean Figma libraries. But it feels like a rather messy approach to me.

I found this plugin that can replace variables but you need to replace one by one.

I plan to support swapping variables by variables matched in my plugin later.

1 Like

Thanks for that @Hal_Lee , will test it :wink:

This is what it says in their guidelines

Copy pasting variables across files

Variables can be used in prototypes.

Currently, if you copy and paste objects to different file, the prototype will continue to work as the variables transfer over. However, any unpublished variables applied to prototypes won’t be available for further use, like when creating Set variable actions, or switching an object’s number variable.

We are working on improving transferring variables across files. As a workaround, either recreate the variables in the destination file, or duplicate the original file.

If the original file is published to team libraries, copied and pasted variables will work as expected.

If you receive a notification that pasting unpublished variables across files won’t create new local variables yet, try publishing the source library and and enabling it in the destination file.

Hey everyone,
To give you an update, with the launch of some new Figma Prototyping updates, you can now copy and paste local variables: when copy and pasting an element with a local variable bound to it, Figma will create a collection with the new, copied variable so it can be used freely in the new file. You can learn in our Help Center article here. Hope this helps!

3 Likes

Hey @Celine_Figma nice that this feature is launched.
I am however wondering if it is possible to move variables from one library to another one.
Like you are able to move already published components to another library by cutting them out and pasting them in the new file. After publishing them inside the new file, all linked instances will remember their master and know it‘s been moved. Therefore no link will break.

I basically want to do the same thing with variables.
Will this be possible anytime soon-ish?

1 Like

Hey Oliver, thanks for your feedback! To be transparent, it’s not on our immediate roadmap at the moment but, it’s definitely on our radar for improvement.
I’m happy to pass your feedback to the team to give them visibility, though I can’t guarantee an ETA for any improvements. Thank you!

3 Likes

Thanks for the update. Good to hear

You can add the variables to a library, then when you import the library the variables are also copied. I did this test just now and it worked well, including actualizations.

Thanks for your input @Luana_Sousa.

I am however thinking of the following issue.
A company creates a library including a lot of components, now Figma has a new feature and they create a lot of variables in the same file. Now they are scaling and even merging with another business unit and see the need for a foundation level and a dedicated token/variables library and even another variables library to add a semantic layer.

As it turns out, their current variables (that are heavily used already in their files) shall be moved to the foundations layer and the dedicated library, WITHOUT UNLINKING all the variables that are used in the tons of other files.

What could they do?

2 Likes

Oliver and i are barking up the same tree.

I desperately need to lift out an entire product’s components and variable information and move them to a dedicated library file while keeping everything linked. Obviously the components are easy with the tools given, and i can even copy variables over and re-link them pretty well to said components using some of the aforementioned plugins…

HOWEVER, all other variables break link (turn grey in the inspector) with any of these methods and i really feel stuck with no way forward short of manually combing through hundreds of frames and manually re-linking variables in non-component designs.

1 Like

We very much need this as well. We have a bunch of variables in a library and want to split off a specific group of them to be in a different library as they are really used by different groups of people. Having them all together is causing complications but I haven’t found a good way to move them without breaking where they are in use already.

The issue at hand has not been solved. This thread shouldn’t be marked as “LAUNCHED”.
There has been a way to cut and paste (effectively, move) styles and components for a while… Now variables are a step back from this :disappointed:

11 Likes

This has not been resolved. Copying and pasting elements does not also copy and paste local variables applied to the element from one file to another. @Celine_Figma This issue is becoming a big problem for our company to maintain and consolidate multiple files who use variables from multiple published libraries.

We need the ability to move local variables that have been published in Figma File A to Figma File B without any files who link to those variables to be de-linked or require any manual updating. At this time, there is NO WAY to move variables from one file to another.

4 Likes

Hi, new to the forum. Just seen this post and I’m having a very similar problem. I want to drag or copy and paste my variables from one collection to another. Anyone figured that out yet?

not solved but there is lip service being paid to knowing it’s an issue at least ¯_(ツ)_/¯