I want to upload google sheets data by converting it to JSON and uploading it with post method to my other website how should I do it?
I am trying to use ajax request but can't figure it out properly. If I can use XMLHttpRequest I might figure it out but I don't know how to do it in Google Apps Scripts.
CodePudding user response:
You should normally show what you have tried so far so we can correct you code if needed.
But, if you're really lost and looking for a direction, what you probably want to do is
- Setup a time-based trigger (for every minute, every day, whatever)
- Use the
SpreadsheetApp
service (doc) to retrieve your sheets data with Apps Script (server-side) - Use the
UrlFetchApp
service (doc) to make a POST request to your website
Since it's a server to server request, there is ajax in here.