Sync data from MySQL through API (more than 200 rows)

Hi there,

I’ve been trying to sync data from MySQL database - retrieve them to bubble apps, edit and save these changes on MySQL db

I found The SQL Database Connector, and I tried using it, it only let me retrieve 200 rows in each query

Though I usually have to retrieve 1000 rows, so I thought about using API plugin to do so, as I’m not a coding person, I’ve been struggling to do it

Has someone tried a solution for this and succeeded?

Thanks in advance,

If your MySQL tables have a unique, sequential identifier, then I think it’s possible using back end workflow recursion. Don’t have time to write all the details, but the backend workflow could do something like:

  • Get all the rows that are new or have changed where the sequential identifier > last identifier ordered by the sequential identifier. For the first time call set the identifier to 0.
  • Call another back end workflow that updates each record recursively until all 200 are updated to the Bubble DB
  • When that finishes, recursively call the initial backend workflow with an only-when condition of mod(count, 200) = 0 (meaning, each grouping of 200, 400, 600, etc. means there’s probably more in the MySQL db to retrieve. Pass it the last identifier so it gets the next 200.

There’s lots of videos out there that can teach you how to call back end workflows recursively, which is Bubble’s solution to looping. Also, you need to be on a paid plan I believe to have access to back end workflow.

Hope that gets you where you need to go.

Joey

2 Likes