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

125
Views
Obtenga el elemento clave en un objeto cuando la clave es una cadena que contiene espacios

Tengo un archivo json con contenido similar al siguiente

 { "dlg-4b2edcfb-7fa5-4a93-a82e-8a6637fb5d7a": [ { "utteranceID": 0, "speaker": "agent", "source": "[UFT]HI, how can i help you?", "target": "[UFT]", "input formality tone": "unacceptable" }, { "utteranceID": 1, "speaker": "customer", "source": "Hi, could you help me with ordering from Starbucks?", "target": "[UFT]", "input formality tone": "unacceptable" } ] }

Necesito extraer valores de la clave "tono de formalidad de entrada". Ya probé este código, pero devuelve null como resultado

 function test() { var file = DriveApp.getFileById("19ncMpYna8VEBCVfvMjbuImFZXPx2Jlw0"); var filecontent = file.getBlob().getDataAsString(); var jsonparse = JSON.parse(filecontent); for (var key in jsonparse) { var arr = jsonparse[key]; for (var i=0; i<arr.length; i++) { var item = arr[i]; Logger.log(item) inputFormalityTone = "input formality tone"; Logger.log(item.inputFormalityTone) } } }

¿Me pueden ayudar a resolver esto? Gracias por adelantado,

about 4 years ago · Juan Pablo Isaza
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!