Automating Your CSV Import
Upload your work order CSV to FourJaw on a schedule, so your data stays current without anyone touching it.
Work Order Management is being rolled out to all customers throughout August
Automating your CSV Import: Upload your work order CSV to FourJaw on a schedule, so your data stays current without anyone touching it.
If you import work orders regularly, you don't have to upload the file manually each time.
In this article, we explain an example middleware that can do it for you: point it at the file your ERP exports, set how often it should run, and it uploads that CSV to FourJaw through the API on schedule. Your work orders keep flowing in on their own.
These are examples, not a supported product. The middleware is a small, self-contained starting point you copy and adapt to your own environment. It's meant to be read in a few minutes and tailored to how you run things, rather than installed as-is. You'll want someone comfortable running a script (your IT team or a developer) to set it up.
What it does
You tell the middleware where your work order CSV lives and how often to run. On that schedule, it takes the latest version of the file, uploads it to FourJaw, notes that the import went through, then waits and does it all again next time.
Because it's talking to the same import endpoint as the manual upload, everything you already know about the import still applies: the same required fields, the same duplicate handling, and the same safe re-import behaviour.
See Importing Work Orders from CSV for the CSV requirements, and Editing Work Orders and Tablet Updates for how re-imports protect your in-app edits.
How it works
Each run does the same simple thing:
- Reads your CSV file from the location you set.
- Sends it to FourJaw, using your API key so it lands in your account.
- Logs the import job ID that FourJaw returns, so you can confirm it went through.
- Waits for the interval you set, then runs again.
You can also run it a single time instead of looping, which is handy for testing your setup before you leave it running.
Before you start
The examples come in both Node.js and Python, so you can use whichever fits your environment. Either way, you'll need:
- A FourJaw API key. Your key identifies your account, so the data lands in the right place. Keep it secret. See Create an API key if you don't have one yet.
- A computer for the script to run on, with access to the CSV file. This is usually a local computer on your network, such as an office PC or a server. For the Node.js example it needs Node.js 20 or later; the Python example has its own equivalent requirements.
Important: The computer needs to be on when an import is due.
The script only runs while the computer it's on is switched on and awake. If you want to import every hour around the clock, for example, that computer has to stay on 24 hours a day. If it's asleep or off when an import is due, that run is simply missed, and the next one happens as normal once it's back on.
For always-on imports, a machine that stays running (like a server) works best.
Setting it up
At a high-level, you add your API key, tell the script where your CSV is and how often to run, then test it once before leaving it running on your schedule.
The exact steps and settings live in the GitHub files, so there's a single, always up-to-date source to follow.
Head to the README on GitHub for the full setup instructions.
A note on secrets
Keep your API key in the .env file and never commit or share it. Anyone with your key can send data to your FourJaw account, so treat it like a password.
Have a question?
Don't hesitate to get in touch with our friendly support team by emailing support@fourjaw.com.