google-apps-scriptgoogle-apps-script-api

How to get Google Apps Script project ID linked/bound to a Google Spreadsheet


I have a task to update Apps Scripts linked to some Spreadsheets using Google REST APIs. I know how to update script if I have script Id, but the problem is that I have only spreadsheet Id, and I need to updated linked/bound script.

I didn't find any method in Apps Script REST API that would allow listing scripts linked to a spreadsheet https://developers.google.com/apps-script/api/reference/rest/

I also tried Google Drive REST APIs https://developers.google.com/drive/api/v2/reference/children/list and https://developers.google.com/drive/api/v2/reference/files/list with no luck.


Solution

  • Currently, it is not possible to retrieve the bound script id from the parent spreadsheet id. You can star(star on top left) these issues to prioritize these issues:

    Depending on your use case, There's a workaround mentioned by Tanaike here