Importing storage locations from a CSV: feedback on the file format

Hi all,

Setting up storage today means creating every room, device, shelf, rack and box one at a time in Storage Management. For a lab with a few freezers that’s hundreds of clicks, so I’ve been working on importing them from a file (Import storage locations · Issue #3243 · DIGI-UW/OpenELIS-Global-2 · GitHub). The backend is up for review in feat(storage): import storage locations from a CSV (backend, #3243) by avanishkasar · Pull Request #5371 · DIGI-UW/OpenELIS-Global-2 · GitHub, and I’d like to check the format with people who set up real labs before I build the screen for it.

How it works now:

  • One CSV row per storage path. The columns are room, room_code, device, device_code, device_type, shelf, rack, rack_code, box, box_code, box_rows and box_columns. A row can stop at any level, so a room with one fridge and no shelves is fine.
  • Each level is matched by name under its parent. If it’s already there it’s reused, otherwise it’s created with the same checks the add forms use.
  • device_type is freezer, refrigerator, cabinet or other. Codes are optional, and a blank one is generated from the name. Box codes are required.
  • Freezers and fridges come in without temperature monitoring. That still gets set up on the device afterwards.
  • Every upload is checked first. You get a list of what would be created and an error for each bad row, and nothing is saved until the whole file is clean. Then you run it again for real.
  • Admins only, up to 5000 rows, with a template you can download.

A few things I’m not sure about:

  1. Do your existing location lists keep anything this doesn’t cover, like temperature ranges or capacity?
  2. Is CSV enough, or do you mostly keep these in Excel?
  3. When a row names a location that already exists, it’s matched by name and left as it is, even if the file gives it a different code. Would you rather it update the existing one, or flag the difference?

Thanks!