Skip to main content

Spreadsheet Lookup

Intro

Lookup values in spreadsheet data based on related text strings (keys). This could be useful, among other things, for creating design systems where many layers share common attributes. For example, in the table below, the key corner-radius would return a value of 10.

KeyValue
corner-radius10

The advantage of using a lookup is that the row can be moved for organisational purposes without losing the link to the value.

UI

File - Connect a .csv or Google Sheet Asset.

Lookup Column - Select the column in the data to search for a key.

Lookup Key - Specify the key (text) to find within the Lookup Column.

Value Column - Select the column to match against the Lookup Key.

Example
  1. Create a Rectangle.
  2. Right click in the Assets Window and select Import Google Sheet...
  3. Paste in this url - https://docs.google.com/spreadsheets/d/1DB4Yv0W_sT1nIlKiQFUBeQyXZoz88tdQt8YvLzXYwbU/edit?usp=sharing
  4. Create a Spreadsheet Lookup.
  5. Drag the Google Sheet from the Assets Window to the File attribute on the Spreadsheet Lookup.
  6. Select the Key column for Lookup Column.
  7. Select the Value column for Value Column.
  8. Enter corner-radius in the Lookup Key.
  9. Connect spreadsheetLookup.idrectangle.cornerRadius.
info

Any changes to the data in the spreadsheet will need to updated by right clicking on the spreadsheet Asset in the Asset Window and selecting Reload.