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

200
Views
Cómo usar las condiciones REST Api y javascript para filtrar elementos de lista

Estoy tratando de filtrar elementos de la lista de puntos compartidos utilizando un filtro API REST y condiciones de JavaScript. Cuando uso == no funciona, solo si uso !=.

 var requestUri = "/_api/web/Lists/GetByTitle('Request For Information')/items?$filter=substringof('" + myQry + "',RFI_nummer)&$orderby=LTIOV asc";

Básicamente, filtro los elementos cuyo RFI_nummer contiene 2022 y los clasifico en LTIOV (que es un campo de fecha)

luego establezco más condiciones como esta:

 $.each(data.d.results, function (i, item){ var stat = item.MijnStatus; var tit = item.Title; var start = item.Created.substring(0, 10); var LTIOV = item.LTIOV.substring(0, 10); var RFInum = item.RFI_nummer; if (stat !="Completed") { var start = parseDate(start); var end = parseDate(LTIOV); if (end <= today.getTime()) { balk_kleur = "ganttRed"; } else { balk_kleur = "ganttGreen"; } demoSource.push({ name: RFInum, desc: LTIOV, values: [{ from: start, to: end, label: tit, customClass: balk_kleur, dataObj: stat }], }); } }) //$.each function parseDate(input) { var str = input.split('-'); var sDate = Date.UTC(str[0], str[1]-1,str[2]); return sDate; } });

Cuando trato de reemplazar if (stat !="Completed") con if (stat =="In Action") no me da los elementos correctos. ¿Qué estoy haciendo mal?

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!