๐Ÿš€ Excel to JSON โ€“ Operation Extension!

Hello everyone!
Iโ€™m excited to share my very first Directus extension: Excel to JSON. This extension lets you easily convert Excel and spreadsheet files into clean JSON, right inside your Directus flows.


What does it do?

  • Supports Excel, CSV, and TSV files
  • Validates file types automatically
  • Outputs structured JSON for your flows

How to use it (itโ€™s super simple!):

  1. Add the Excel to JSON operation to your flow.
  2. Pass the file ID of your uploaded spreadsheet.
  3. Done! Instantly get your data as JSON for further automation.

Installation:

You can install it from the Directus Marketplace if MARKETPLACE_TRUST=all is set; otherwise, manual install is needed.
Note: Currently, it supports only local storage files; cloud storage support is coming soon.


Feedback & Collaboration

This is my first extension, so any help, advice, or feedback is very welcome!
If you have suggestions, ideas, or want to contribute, please check out the repo or leave a comment.

GitHub: directus-operation-excel-to-json

4 Likes

Thanks for sharing @Abdallah! This is great.

1 Like

Does this support batching? I have some files with 400,000+ lines and Iโ€™m trying to find a way to efficiently and reliably add or update based on the primary key. I understand your plugin will parse my excel document, and create Json. However, if would be nice if it generated batches of JSON in X count per batch so I donโ€™t overload the system when doing so.

I donโ€™t think the extension currently support such a large number of rows, since in line 29 we buffer the whole file at once. Also in line 36 we extract the entire file result. So, that wonโ€™t work with big files.
imho, I think you need to split the file into chunks using the current package (if SheetJS supports that) or using similar package to split or stream it.

Iโ€™m trying to find a way to efficiently and reliably add or update based on the primary key

Whatโ€™s also good about Directus is that in the for loops (using the trigger flow operation) you can select the iteration mode to handle the update process