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

451
Vistas
How to loop through a JSON array using for each in Zoho CRM Deluge script

**im a bit confused on how to declare an array in a deluge script. I have seen the references online but somehow i may not be using this syntax right:

x = List();

** and here is my foreach loop enter image description here

request_body is receiving the JSON array from my server

I get an error Argument type mismatches for the integration function 'zoho.crm.createrecord' at index 2 Line Number: 15

this my code to send the JSON array to CRM

async function sendToCRM(pets) {
    var jsonPets = JSON.stringify(pets)

    superagent
    .post(insertPet_URL)
    .set("Content-Type", "application/json")
    .send(jsonPets)
    .end((e, r) => {
      console.log(r.body)
    })// sends a JSON post body
  }

  app.post("/pets", (req,res)=> {
    var pets = req.body
    var petsData = []

    pets.forEach(function(pet){
      var tmp = {}

      tmp["Name"] = pet.Ngalan
      tmp["Pet_Owner"] = pet.Tagiya
      tmp["Contact_Number"] = pet.Numero
      tmp["Birthdate"] = pet.Kaadlawan
      tmp["Breed"] = pet.Rasa

      petsData.push(tmp)
    })
    console.log(petsData)
    sendToCRM(petsData)
    res.send(req.body)
    res.status(200)
  })

there has been no problem on the server side and im able to receive this JSON array from Postman which is the one im going to send to CRM deluge. Here is my JSON array:

[{"Ngalan":"Hachi","Tagiya":"Rex","Numero":"09778135353","Kaadlawan":"2020-12-12","Rasa":"Akita Inu"},{"Ngalan":"qwe","Tagiya":"Rex","Numero":"09778135353","Kaadlawan":"2020-12-12","Rasa":"Akita Inu"}]

Any help would be much appreciated. Thanks!

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Make the request_body.tojsonlist(). then it work

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