Copying the URL/URI of Embedded charts in Google Sheets via Google Apps Script

22 views
Skip to first unread message

Bansi Shah

unread,
Dec 12, 2017, 6:40:05 AM12/12/17
to Google Visualization API

How can I extract the URL/URI link from a googlesheet embedded chart?


I have created a number of embedded charts from my google sheet data.  The charts are of course embedded in the google sheets too. What I want to do is extract the URI of the chart itself. I initially was looking to get the URL of the chart but google sheet class libraries specify URI (as URL is deprecated).


I then intend to post the URI via a google sheet addon (Autocrat) to a PDF document in which the full chart image will be pushed. Autocrat accepts tags of the data to be copied into the PDF document, be they be ‘standard data/text’ or ‘image’ for charts etc

The URI link of the embedded chart can be seen and accessed manually via the 'Publish Chart' menu in the embedded chart itself. I can manually copy this link and paste it into an expernal document.


However, the issue I have is that this needs to be done manually.  I want my GAS script to extract the URI automatically as soon as the embedded chart is created and post it in full to a designated cell in the sheet.


Has anyone done this or make suggestions on how it can be coded using Google Apps Script?

Reply all
Reply to author
Forward
0 new messages