Tag: CSV

  • Formidable Forms: Export Large Views to One CSV in Batches Without Timing Out

    Formidable Forms: Export Large Views to One CSV in Batches Without Timing Out

    I have a client, who is actually a very close friend of mine, running a sales tracker on F. Every branch submits its shift sales through a form, and the team reviews everything in a Formidable View with filters for date, branch and POS type. It works great, until somebody clicks the Export to Excel link at the bottom of the View.

    With more than 27,000 entries in the form, the export just spins and then times out. So I wrote a small plugin that exports the same entries in batches and still gives you one CSV file at the end. Here is how it works, and the full code is at the bottom of this post.

    Why the default export times out

    The View export builds the entire CSV inside a single web request. It loads every matching entry, formats every field, and only then sends the file. With a few hundred entries you never notice. With tens of thousands, that one request runs longer than PHP and the web server allow, and the server kills it before the file is ready.

    (more…)