Skip to content

Find or create a Descartes BoxTop job without duplicates

Keying a shipment into a TMS by hand is slow, and automating it creates a new risk: the second email about the same shipment makes a second job. BoxTop’s API documents no duplicate protection, so this recipe searches for the customer’s reference before it creates anything.

Created and Existing both continue, so a repeat email attaches to the same job.

Add a BoxTop connection and choose Sample data. It needs no key, answers from a fixed set of fictional records and sends nothing, so you can build and run the whole automation first. Every answer from it has sample set to true.

Start from Email received or an Operation form, and read the documents into fields: at least the customer’s account number and reference. Put a person in the loop if a wrong job would be costly.

Add Find or create BoxTop job with the Job prefix, Account number and Reference, and any other fields you have.

It looks for a job with that account and reference first. If there is none, it creates one and reads it back. Connect both the Created and Existing exits to the next block, so the run goes on either way.

An existing job is used as it is, and your new values are ignored. BoxTop’s help lists no general job update. If the values could differ, read the job with Find BoxTop job and compare them with Checklist before you carry on.

  • A create times out. A rate limit, server error or timeout on the create says the job may have landed. So does a read-back that finds nothing. Check BoxTop before you run the step again.
  • Running a step again can still duplicate. Find or create searches first, so it finds a job that landed. But if BoxTop can’t list the new job yet, it creates a second one.
  • Attach runs again from the first file. A rerun of Attach BoxTop documents can add files twice. It stops at the first file it can’t attach, and the files already accepted stay on the job.
  • A job with a blank reference never matches. Treat an empty reference as an error before this block.
  • A wrong API address can look like Not found on a job number search in Find BoxTop job, so don’t take it as proof the job is absent.

Last updated: