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

190
Visualizações
Trying to figure out a way to search a JSON file received from ninox API

I'm a junior in college so i'm not fully experienced in coding just yet; However recently I got an internship and I was assigned a task to create a website that connects to the ninox database. So far i've been able to properly connect to the API endpoints and receive the JSON that contains all of the records stored in a specific database. Now i'm trying to work on a function that searches through the JSON file and returns values that match what was in the search box. Looking online for a solution I was able to find functions that use the JQuery RegEx() function but i'm not exactly sure how to implement that,and also i'm trying to store the JSON data into a variable and i'm not sure if its formatted correctly. Heres my current code:

//current fucntion function search(){ //gets value from search bar. not sure if this even needs to be used if regEx is used. let sName = document.getElementById('searchBar').value; var entry; sName = sName.toUpperCase();

//connects to API endpoint
var request2 = new XMLHttpRequest();
var accessToken = 'my token is here';
request2.open('GET','my URL is here');
request2.setRequestHeader('Authorization', 'Bearer ' + accessToken);
//function that stores the JSON reply into a variable
request2.onload = function(){
    // this contains the JSON data
    var data = JSON.parse(this.response)
    if (request2.status >= 200 && request2.status < 400) {
        //this currently just stores JSON data on webpage for testing purposes
        document.getElementById("JSON").innerText += JSON.stringify(data);
    } else {
        alert('error');
    }
}
request2.send();

alert(sName);

}

The JSON it returns is: JSON

I'm trying to search through both the Title and Synopsis Keys for matching strings. Any ideas that would help me achieve this would be greatly appreciated!

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