Read Data from MySql and importing to Google Spreadsheet daily

Hello everyone,

I read a ton of posts but never found a solution that fits to my case.
I have a website that uses a MySql database. I linked one table of this DB to my appsheet application. I want to preserve this DB in order to not creating any problem to my website.
I would like to pull informations from this โ€œread only DBโ€ and put them in a google sheet where I can freely develop the application. I would like to do it automatically to every sync or daily/time dependent.

I just created all the references between my โ€œOrder MySql DBโ€ and โ€œOrder Google Sheetโ€.

I was only able to create a โ€œSyncโ€ action that do this for me, but I have to trigger it manually and select every order.

I would like to sync everything every time thereโ€™s a new order on my Mysql DB

Is there any way???

Thanks in advance

1 12 1,201
12 REPLIES 12

Unfortunately the automatic update is reading data with only 30minutes intervals.

I would be ok! How can I activate it?

Set both options Behavior > Offline/Sync > Delayed sync and Automatic updates as ON.

Thanks for your help but thatโ€™s not what I want.
I try to explain better.

I have one mysql table that is a read-only table (letโ€™s call it โ€œmysql tableโ€) and that is updated by another software running on a website.

I created a support table on google spreadsheet that we can call โ€œgoogle tableโ€.

My objective is: every time there is a new row in โ€œmysql tableโ€ (added externally of appsheet) -> create a new row in โ€œgoogle tableโ€ copying the same datas

Can I do it?

Yes you can. I havenโ€™t done this and I understand there is no SQL support in Google sheets. However, you can create Google scripts that use JDBC libraries to make SQL connections to pull data from the database into the Google sheet.

EDITED:  I just re-read you post from above.  It sounds like you already are feeding data from SQL into
 Google?  If so then its just a matter of scripting it so it happens automatically on updates  OR  on a set 
timer within the script.  I believe either are doable but you'll need to research how.

This is outside of AppSheet functionality. The link below can help get you started and then you can go from there.

Iโ€™m still not feeding Google Sheet from SQL, I thought to do it through appsheet.
Maybe the correct solution is to do it externally? Iโ€™m going to study the link you posted.

@Aleksi really got the point, the easiest thing for me would be a trigger that copies every new record in MySQL to a spreadsheet automatically!

Yes understood - copy to Google sheet automatically once row inserted into SQL.

AppSheet does have the capability of connecting to your MySQL database but it is expensive to do that.

I assume you are looking for ways to avoid the db connection costs?

If so and if you are looking for a way to update G-sheet from your MySQL database, you WILL have to rely on external services to handle that for you.

John has a pointโ€ฆ you need to use for example Scripting.

creo que te puedo ayudar haciendo un robot.

So, you want to have a trigger that copies a new record from your MySQL to a spreadsheet automatically?

exactly!

The scripting thing is quite difficult, moreover I donโ€™t want a complete copy every time, Iโ€™d like an update โ€œonly new rowsโ€ .

I think Iโ€™m gonna do like this:
2 views in the app

  • First View is the MySql table view. If I tap on an order, I activate an action that โ€œadds a new row in another table using the values of this rowโ€.
    Then set the columns that I need in the other table.
  • Second view is the spreadsheet table view, where I can work without affecting the original Mysql table.

Thank you for helping me coming to this solution.
If something isnโ€™t clear and you are interested in it I can explain it better.

Thanks

Top Labels in this Space