Database

Apply Data and Generate

How Apply Data writes data into layers: the scope, what happens to text, images, instance properties and directives, Auto-hide unused. How Generate instances multiplies a template by data rows and which Figma limits matter.

Two ways to write data into a design through a mapping:

ActionWhat it doesPurpose
Apply DataFills the layers that already exist in the chosen scopeUpdate a finished design in place
Generate instancesMultiplies a template by data rows and fills every copyLists, tables and card grids of many rows

Apply Data

The Apply Data button in the plugin header finds layers in the chosen scope whose names match mapping fields and writes the data values into them.

Scope

The arrow next to the button picks the scope:

The Apply Data scope menu: Selection, Page, Document.

ScopeWhat is processed
SelectionThe selected layers and everything inside them. Default
PageThe current page
DocumentAll pages of the file

Use Selection for quick checks and Page or Document for a full update. If the selection has no matching layers, the button is disabled and suggests switching the scope.

What goes into layers

Value in the dataLayerResult
Plain textA text layerReplaces the text
An image address, an asset or a repository fileA layer with a fillPlaces the image as a fill
@prop:Name=valueA component instanceSets component properties
@node:…, @hide, @showA layer or its containerChanges visibility, opacity, lock
@rows:NA container with rowsKeeps the first N rows visible
true or falseA component instanceToggles the instance's first boolean property

A layer counts as a target when its name or text matches the mapping's Target Layer field, case-sensitively. If several mappings write into one layer, fields of the cell/table group win, then other cell/ groups, then the rest.

Auto-hide unused

The Auto-hide unused toggle in the mapping editor hides text layers inside a filled row that received no value. Mapping targets and layers already filled are never hidden. It works when the mapping is bound to a component with Bind Selected.

Result

After the run the notification says how many layers received data. Skipped fields are listed as items with the reason and the fix: no matching dataset (check the Key Expression and the dataset name), an empty value (fill the cells or give the field a default), a layer of the wrong kind (text needs a text layer, images and colors need a layer with fills). When nothing was written the result is an error with the same list: no mappings, fields without a Target Layer, no layers named after the fields in the scope — the notification names the layers it looked for and suggests switching the scope.

Generate instances

The Generate instance button at the bottom of the Database tree opens the Generate instances window. If the source has no mapping with fields, the window says No .map.json files ready.

The Generate instances window: the mapping picker with the row count, the All / Limit switch and the button with the number of copies to create.

  1. Select the template: a component instance or an auto-layout frame that will hold the rows. The window reminds you: Requires an auto-layout frame or instance in the current selection.
  2. In the window choose the Mapping: only mappings with fields are listed, with the number of data rows next to them. If there are no rows, the hint No rows found appears.
  3. In the Instances field choose the number of rows: All or Limit with a cap.
  4. Press the Generate N instances button. The plugin shows Generating N rows…, then Generated N rows, and selects the created rows.

If the mapping is bound to a component, the template is checked: a different component gives the error Template does not match bound component.

The plugin clears previously generated rows in the container, keeps the template, creates copies for every row and fills them with the chosen mapping. Composition templates written in text as {{…}} are expanded as well.

Figma limits

  • An extra row in nested tables. In deep structures such as table → rows → row instance, Figma may leave one inherited row the plugin cannot delete. The plugin warns about it; remove the row by hand.
  • Speed on deep instances. Writing text into deeply nested instance layers can take hundreds of milliseconds per cell. Keep the row structure simpler for large data sets.
  • Fonts. The plugin loads fonts itself, but an unavailable font blocks writing text into a layer. Install the font or replace it in the template.

Tips

  1. Start with the Selection scope.
  2. Give target layers unique, clear names and use them in the mapping.
  3. Enable Bind Selected in the mapping so Generate checks the template.
  4. For large tables generate in parts or simplify the row.