title: How to copy Table from a Spreadsheet to a Google Doc as `link to Spreadsheet`?
body: <p>When users copy a range manually from a spreadsheet and paste it into a Google Doc, it prompts the option to &quot;link to spreadsheet&quot; and &quot;paste normally&quot;.</p>
  <p>I needed to do the functionality of &quot;linked to a spreadsheet using google apps script&quot;</p>
  <p><a href="https://i.stack.imgur.com/0m5iu.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0m5iu.gif" alt="link to spreadsheet while pasting manually" /></a></p>
  <hr />
  <p><strong>Use case context</strong></p>
  <p>We have a spreadsheet with a table we are trying to copy to our final document where the user can add additional stuff.</p>
  <p>So if for any reason some value needs to change in the spreadsheet, our users just want to simply refresh the table data.</p>