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

112
Vistas
Javascript object nested filtering

I have an object parsed from JSON output.

I have to use only pure JS without any 3rd part libs. Can somebody suggest a working solution to filter a specific nested object by one of its key's value. In this sample I have a few "Fields" objects which contains also nested objects.

So is there a way to filter the whole nested object inside Fields using VName value as a filter criteria? For example use "VName": "oc_data" to filter the whole object inside Fields oc_data belongs to

[{
    "Id": "0050560107dd",
    "Name": "Demo Range",
    "AllMup": false,
    "Lines": [{
        "Id": "0050560107dd",
        "AllMup": false,
        "Fields": [{
          "Id": "0050560107dd",
          "Name": "Some value here",
          "VName": "oc_data",
          "IsRequired": false,
          "Format": {
            "Type": "Dictionary",
            "Dictionary": {
              "Name": "Main stuff",
              "SysName": "da3a45de77d1",
              "ValuesUrl": "https://mysityurl.com",
              "Id": "0050560107dd",
            },
            "CalForm": []
          }
        }]
      },
      {
        "Id": "0050560107dd",
        "AllMup": false,
        "Fields": [{
          "Id": "0050560107dd",
          "Name": "Some value again",
          "VName": "task_stat",
          "IsRequired": false,
          "Format": {
            "Type": "Dictionary",
            "Dictionary": {
              "Name": "Task stuff",
              "SysName": "Tasks.TaskState",
              "ValuesUrl": "https://mysecondurl.com",
              "Id": "ac1f6b17f99d",
            },
            "CalForm": []
          }
        }]
      }
    ]
  },
  {
    "Id": "0050560107dd",
    "Name": "Demo Range",
    "AllMup": false,
    "Lines": [{
      "Id": "0050560107dd",
      "AllMup": false,
      "Fields": [{
        "Id": "0050560107dd",
        "Name": "Category",
        "IsRequired": false,
        "Format": {
          "Type": "Dictionary",
          "Dictionary": {
            "Name": "Some category",
            "SysName": "LitigationCategory",
            "ValuesUrl": "https://myempty.com",
            "Id": "902b343a9588",
          },
          "CalForm": []
        }
      }]
    }]
  }
]

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