Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

217
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda