Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

215
Views
Script to copy template table. Dropdown boxes error

​​I have created a script that copy template table from one docs to another.

function onOpen() {
  var ui = DocumentApp.getUi();
  ui.createMenu('Templates')
      .addItem('some_items', 'appendTemplate')
      .addToUi();
}

​function appendTemplate() {
    var sourcedoc = DocumentApp.openById("DocID");
    var sourcebody = sourcedoc.getBody();
    var tables = sourcebody.getTables();
    var table = tables[0].copy();
    var destdoc = DocumentApp.getActiveDocument();
    var destbody = destdoc.getBody();
    var x = destbody.appendTable(table)
}

When I exec this script the table correctly copy to target document but dropdown boxes are without default colours.

when I tried to click any of them I got an error "unable to load file".

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

As the time this answer was posted, the Documents Service (Class DocumentApp) hasn't methods to handle dropdowns, only for Smart Chips (see Release note August 23, 2021). This might explain the issue.

I don't think that there might a workaround to use Google Apps Script or the Documents API to copy a dropdown without having the erro.

Resources

  • Insert smart chips & building blocks in your Google Doc

Related

  • How to insert RichLink (Chip Block) in Google Docs using Google App Script
  • Get Google "pills" value as Plain text from Google docs with Google Apps Script
  • How to get in Apps Script the value of a dropdown in a Google Doc?
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!