Programmatically update data on draft

Hi all.
I created some draft and want to use real data.
I found plugin “Json to Figma” and managed to visualise the data from uploaded json file.
I want to be able to update real data from json file programmatically and export pdf from updated draft using python.
I have tried to find how to do this using API but without success.
I would be very grateful if someone could help me with this and give me a working example of how to achieve this.

1 Like

Hello @Vlad15, Thank you for contacting us about this.

As we wait for our community to provide input on your question, I’ll also check internally to see if we have any relevant information. we’ll updated once I receive any information.

Thank you again for reaching out!

Hello, after consulting with the internal team, we have some advice for you.

You can learn about using the Plugin API from here. In particular, you might interested in using exportAsync to export the design as a PDF once the design has been populated with the JSON data.

If you are seeking a way to update a Figma file from outside of Figma (based on the export pdf from updated draft using python). This isn’t currently possible.
You would need to develop a Figma plugin and then, when you wish to update the Figma file with new data:

  1. Open the file in Figma
  2. Run the plugin
  3. Export the PDF using Figma’s export feature

We hope this helps! If anyone in our community has additional insights or suggestions, please feel free to share them.