google-apps-scriptpostdata

submit data from one workbook to another workbook


I need to post/submit data from the source workbook to the destination workbook(id) > worksheet

I have achieved this task by using the below code, but I need help posting to a different workbook > worksheet

https://docs.google.com/spreadsheets/d/1NY_ckzEWxU7DCGro5tTqzpiOi6iG5PAQFxpZg0OKodY/edit?usp=sharing


Solution

  • Try

    var datasheet = SpreadsheetApp.openById('id of the target spreadsheet').getSheetByName("DataSheet")
    

    openById