Original Colelab here
Updated example to:
- GoogleApis 52.x.x
- Google Auth library 6.x.x
OAUTH script consent to internal to use the app inside your company
Here are some additional ideas for making an even more compelling integration:
Rather than have the user click a button to sync, update the spreadsheets automatically whenever orders are changed. You'd need to request offline access from your users, and keep track of which user owns a given spreadsheet.
Allow users to modify order details in the spreadsheet and push those changes back into the application. You could use Google Drive push notifications to detect when the spreadsheet has been updated and the Sheets API's spreadsheets.values.get to pull in the updated data.
Read the Google Sheets API developer documentation. Post questions and find answers on Stackoverflow under the google-sheets-api tag.