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

270
Vistas
Scripted access for multiple importrange IDs

my first post so apologies for any wrong links and format.

I found a very useful piece of script in the link below, and specifically in the code text. It works great for single import ranges, but I need to have multiple sheets linked in the Const donorID and in the Const URL. Is this possible?

Is sO, please assist with a sample modified script.

How to allow access for importrange function via apps script?

 function addImportrangePermission() {
  // id of the spreadsheet to add permission to import
  const ssId = SpreadsheetApp.getActiveSpreadsheet().getId();

  // donor or source spreadsheet id, you should get it somewhere
  const donorId = '1GrELZHlEKu_QbBVqv...';

  // adding permission by fetching this url
  const url = `https://docs.google.com/spreadsheets/d/${ssId}/externaldata/addimportrangepermissions?donorDocId=${donorId}`;

  const token = ScriptApp.getOAuthToken();

  const params = {
    method: 'post',
    headers: {
      Authorization: 'Bearer ' + token,
    },
    muteHttpExceptions: true
  };
  
  UrlFetchApp.fetch(url, params);
}
about 4 years ago · Juan Pablo Isaza
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