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

133
Views
crear un objeto con diferente rancho de datos en Google App Script

Quiero crear una función que cree 2 objetos diferentes con un rancho diferente de datos de una Hoja. Pero dice:
Excepción: los parámetros (String, String, String, String, String, String, String) no coinciden con la firma del método para SpreadsheetApp.Sheet.getRangeList. el error es de la variable let data_Spiceblend

PD: solo soy un principiante en la programación, así que si encuentras esta pregunta estúpida, lo siento: / Eso es lo que hice:

 let sheet = openSheet("Spices list"); let data_SpiceBlend = sheet.getRangeList('B67:B83','B85:B86','B88:B114','B116:B134','B136:B147','B149:B154','B156:B223','B225').getValues(); let data_SpiceMix = sheet.getRange("B21:B65","B232:B242").getValues(); let blend_Obj = {}; let mix_Obj = {}; let blendSku = data_SpiceBlend[0]; let mixSku = data_SpiceMix[0]; let blendContent = []; let mixContent = []; for (let row of data_SpiceBlend) { obj[blendSku] = blendContent; blendSku = row[0]; blendContent = []; } for (let row of data_SpiceMix) { obj[mixSku] = mixContent; mixSku = row[0]; mixContent = []; } blend_Obj[blendSku] = blendContent; mix_Obj[mixSku] = mixContent; model.blend = blend_Obj; model.mix = mix_Obj; }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Responder:

El método getRangeList() toma una matriz de rangos, especificada como cadenas.

Cambio de código:

 let data_SpiceBlend = sheet.getRangeList('B67:B83','B85:B86','B88:B114','B116:B134','B136:B147','B149:B154','B156:B223','B225').getValues()

debiera ser:

 let data_SpiceBlend = sheet.getRangeList(['B67:B83','B85:B86','B88:B114','B116:B134','B136:B147','B149:B154','B156:B223','B225']).getRanges().getValues()

Tenga en cuenta el [] que encapsula la lista de notaciones A1.

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!