Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

207
Visualizações
Zapier Zap doesn't run when it is supposed to

I created a zap that was supposed to run when a new lead is added on our platform and save it to google sheets. When I test the trigger it is working correctly . However when I turn on the zap it doesn't trigger when a new Lead is added . Even when I run it manually by "Run Zap" It says that there are no new leads ,but there are . When I go to test the trigger by clicking "load more" it gets the new lead with no problem . I tried turning the zap on and off - nothing seems to work. Here is the code I am using for the request .

const currentDate = new Date();
const year = currentDate.getFullYear();
const month = currentDate.getMonth() + 1;
const day = currentDate.getDate();


const options = {
  url: 'api_url',
  method: 'GET',
  headers: {
    'Content-Type': 'application/json',
    'Accept': 'application/json',
    'x-api-key': bundle.authData['api-key'],
    'client_id': bundle.authData['client_id']
  },
  params: {
    'year': year,
    'month': month,
    'day': day,
    'page_size': '1000'
  }
}



return z.request(options)
  .then((response) => {
    response.throwForStatus();
    const results = response.json;

    // You can do any parsing you need for results here before returning them
    for(let i = 0; i < results.data.length; i++){
      
      if(typeof results.data[i].id === 'undefined'){
        results.data[i].id = i;
      }
      
      //formating page urls
      let charArr = results.data[i].page_url_list.split('');
      for(let j = 0; j < charArr.length; j++){
        if(charArr[j] === /\n/ || charArr[j] === /\r/){
          charArr[j] = " ";
        }
      }
      
      const jsonObj = JSON.parse(charArr.join(''));
      const URLS = [];
      for(let k = 0; k < jsonObj.pages.length; k++){
        URLS.push(jsonObj.pages[k].page_url + "\n");
      }
      
      results.data[i].page_url_list = URLS.toString();
      
      
      //formating the timestamp 
      results.data[i].time = new Date(Number(results.data[i].time));
      
    }

  return results.data;
});
about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

To such triggers when a new lead is added you have to use to webhooks(https://zapier.com/page/webhooks/) or build your zapier Apps using resthooks(https://platform.zapier.com/cli_tutorials/resthooks).

about 4 years ago · Juan Pablo Isaza Relatório

0

I just set results.data[i].id = results.data[i].time and the zap is now working correctly

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda