google-sheets-sync-figma icon indicating copy to clipboard operation
google-sheets-sync-figma copied to clipboard

Google Sheets Sync Plugin Incorrect Layer Duplication in Figma

Open cro-ash opened this issue 1 year ago • 0 comments

Describe the bug When using the Google Sheets Sync plugin with Figma, there seems to be a bug in the layer duplication process. Specifically, when I have a list of values in my Google Sheet, the plugin is supposed to create an equal number of child layers within a frame with auto layout in Figma. However, instead of creating a new layer for each unique value, the plugin duplicates the first layer multiple times and replaces the last unique value with a duplicate of the first.

To Reproduce

  1. Create a Google Sheet with a list of values (e.g., different depths like 15cm, 40cm, 50cm, 60cm, 70cm).
  2. Set up a Figma file with a frame that has auto layout applied.
  3. Rename the layer to include @# in the name to prepare for duplication.
  4. Run the Google Sheets Sync plugin.
  5. Observe that the plugin duplicates the first child layer multiple times and overrides the last value with a duplicate of the first one.

Expected behavior The expected behavior is that the plugin should duplicate the first child layer within the frame enough times to match the number of values in the Google Sheet, with each layer representing a unique value from the Sheet.

Additional context The bug occurred when syncing a simple list of values representing depths (15cm, 40cm, 50cm, 60cm, 70cm). Instead of getting five unique layers for each depth, the final layer (70cm) was incorrectly duplicated as the first value (15cm), leading to an inaccurate representation of the data in the design file. This suggests a problem with the plugin's iteration or duplication logic when handling the end of the data set. excel Figma

Please find attached a screenshot illustrating the issue and links to the relevant Figma file and Google Sheet for further investigation.

cro-ash avatar Jan 15 '24 08:01 cro-ash