ERROR: The provided field 'xxxx' is not an array

Hi guys,

Just a quick question, I seem to be stuck with this today, and I’m sure it’s some detail I’m not seeing… :thinking:

Please share the workflow

The idea is to split the calls into rows to store them in a Baserow table.

Information on your n8n setup

  • n8n version: 0.217.0
  • Database you’re using (default: SQLite): SQLite
  • Running n8n with the execution process [own(default), main]: own
  • Running n8n via [Docker, npm, n8n.cloud, desktop app]: Docker

Hi @martinhache,

Are you sure that field is an array? It doesn’t look like one. Can you share the JSON output of the node that will let us see a bit more.

Of course. This is the output of the Http Request node.

[
  {
    "advertencia": "La reutilización de los datos del Sistema Nacional de Publicidad de Subvenciones y Ayudas Públicas está sujeta a una serie de restricciones y consideraciones legales. Consulte el aviso legal en https://www.infosubvenciones.es/bdnstrans/GE/es/avisolegal.Además, el usuario debe ser consciente que la información presentada es de naturaleza dinámica, y que los datos pueden ser sometidos a correcciones, inserciones, modificaciones y eliminaciones en momentos posteriores a su extracción.",
    "fecha-descarga": "24/02/2023",
    "page-size": 5,
    "next": "http://www.infosubvenciones.es/bdnstrans/GE/es/api/v2.1/listadoconvocatoria?fecha-desde=03%2F01%2F2022&fecha-hasta=03%2F01%2F2022&page-size=5&page=1",
    "page": 0,
    "total-pages": 27,
    "convocatorias": {
      "convocatoria - orden 1": {
        "codigo-BDNS": "604390",
        "mrr": "0",
        "dir3-organo": "A12017397",
        "desc-organo": "GALICIA - CONSELLERÍA DE POLÍTICA SOCIAL Y JUVENTUD",
        "sa-number": "",
        "fecha-registro": "03/01/2022",
        "fecha-mod": "03/01/2022",
        "titulo": "Orde axudas para a continuidade das casas niño",
        "titulo-cooficial": "",
        "inicio-solicitud": "12/01/2022 - día seguinte ao da publicación no DOG",
        "fin-solicitud": "14/02/2022 - un mes despois da publicación no DOG",
        "abierto": "0",
        "region": [
          "ES11 - GALICIA"
        ],
        "tipo-beneficiario": [
          {
            "codigo": "FSA",
            "descripcion": "PERSONAS FÍSICAS QUE NO DESARROLLAN ACTIVIDAD ECONÓMICA"
          }
        ],
        "finalidad": {
          "codigo": "10",
          "descripcion": "EDUCACIÓN"
        },
        "instrumento": [
          {
            "codigo": "SUBV",
            "descripcion": "SUBVENCIÓN Y ENTREGA DINERARIA SIN CONTRAPRESTACIÓN "
          }
        ],
        "sector": [
          {
            "codigo": "85.2",
            "descripcion": "Educación primaria"
          }
        ],
        "descripcionBR": "Orden de axudas para a contunidade das casas niño ",
        "URLespBR": "https://www.xunta.gal/diario-oficial-galicia/",
        "financiacion": [
          {
            "codigo": "PCA",
            "descripcion": "PRESUPUESTOS GENERALES DE LAS COMUNIDADES AUTÓNOMAS",
            "importe": "4746000"
          }
        ],
        "fondoUE": "",
        "permalink-convocatoria": "http://www.infosubvenciones.es/bdnstrans/GE/es/convocatoria/604390",
        "permalink-concesiones": "http://www.infosubvenciones.es/bdnstrans/GE/es/concesiones/convocatoria/604390"
      },
      "convocatoria - orden 2": {
        "codigo-BDNS": "604389",
        "mrr": "0",
        "dir3-organo": "A12017397",
        "desc-organo": "GALICIA - CONSELLERÍA DE POLÍTICA SOCIAL Y JUVENTUD",
        "sa-number": "",
        "fecha-registro": "03/01/2022",
        "fecha-mod": "03/01/2022",
        "titulo": "Orden tarxeta bencvida",
        "titulo-cooficial": "",
        "inicio-solicitud": "12/01/2022 - dia despois da publicación",
        "fin-solicitud": "31/03/2023 - dous meses desde o nacemento",
        "abierto": "0",
        "region": [
          "ES11 - GALICIA"
        ],
        "tipo-beneficiario": [
          {
            "codigo": "FSA",
            "descripcion": "PERSONAS FÍSICAS QUE NO DESARROLLAN ACTIVIDAD ECONÓMICA"
          }
        ],
        "finalidad": {
          "codigo": "5",
          "descripcion": "SERVICIOS SOCIALES Y PROMOCIÓN SOCIAL"
        },
        "instrumento": [
          {
            "codigo": "SUBV",
            "descripcion": "SUBVENCIÓN Y ENTREGA DINERARIA SIN CONTRAPRESTACIÓN "
          }
        ],
        "sector": [
          {
            "codigo": "88.9",
            "descripcion": "Otras actividades de servicios sociales sin alojamiento"
          }
        ],
        "descripcionBR": "Orde de axudas a través da tarxeta benvida",
        "URLespBR": "https://www.xunta.gal/diario-oficial-galicia/",
        "financiacion": [
          {
            "codigo": "PCA",
            "descripcion": "PRESUPUESTOS GENERALES DE LAS COMUNIDADES AUTÓNOMAS",
            "importe": "30542072"
          }
        ],
        "fondoUE": "",
        "permalink-convocatoria": "http://www.infosubvenciones.es/bdnstrans/GE/es/convocatoria/604389",
        "permalink-concesiones": "http://www.infosubvenciones.es/bdnstrans/GE/es/concesiones/convocatoria/604389"
      },
      "convocatoria - orden 3": {
        "codigo-BDNS": "604388",
        "mrr": "0",
        "dir3-organo": "A03028313",
        "desc-organo": "PRINCIPADO DE ASTURIAS - CONSEJERÍA DE DERECHOS SOCIALES Y BIENESTAR",
        "sa-number": "",
        "fecha-registro": "03/01/2022",
        "fecha-mod": "03/01/2022",
        "titulo": "Resolución por la que se autoriza y dispone el gasto así como se concede subvención a favor de diversas entidades locales del Principado de Asturias para refuerzo de las prestaciones sociales básicas durante el año 2021",
        "titulo-cooficial": "",
        "inicio-solicitud": "01/01/2021",
        "fin-solicitud": "30/11/2021",
        "abierto": "0",
        "region": [
          "ES12 - PRINCIPADO DE ASTURIAS"
        ],
        "tipo-beneficiario": [
          {
            "codigo": "JSA",
            "descripcion": "PERSONAS JURÍDICAS QUE NO DESARROLLAN ACTIVIDAD ECONÓMICA"
          }
        ],
        "finalidad": {
          "codigo": "5",
          "descripcion": "SERVICIOS SOCIALES Y PROMOCIÓN SOCIAL"
        },
        "instrumento": [
          {
            "codigo": "SUBV",
            "descripcion": "SUBVENCIÓN Y ENTREGA DINERARIA SIN CONTRAPRESTACIÓN "
          }
        ],
        "sector": [
          {
            "codigo": "Q",
            "descripcion": "ACTIVIDADES SANITARIAS Y DE SERVICIOS SOCIALES"
          }
        ],
        "descripcionBR": "Decreto 71/92, de 29 de octubre, por el que se regula el régimen general de subvenciones",
        "URLespBR": "https://sede.asturias.es/bopa/disposiciones/repositorio/LEGISLACION16/66/1/E3183009E11748E3B530580C1ECB9489.pdf",
        "financiacion": [
          {
            "codigo": "PCA",
            "descripcion": "PRESUPUESTOS GENERALES DE LAS COMUNIDADES AUTÓNOMAS",
            "importe": "1335117.92"
          }
        ],
        "fondoUE": "",
        "permalink-convocatoria": "http://www.infosubvenciones.es/bdnstrans/GE/es/convocatoria/604388",
        "permalink-concesiones": "http://www.infosubvenciones.es/bdnstrans/GE/es/concesiones/convocatoria/604388"
      },
      "convocatoria - orden 4": {
        "codigo-BDNS": "604387",
        "mrr": "0",
        "dir3-organo": "A03028311",
        "desc-organo": "PRINCIPADO DE ASTURIAS - CONSEJERÍA DE INDUSTRIA, EMPLEO Y PROMOCIÓN ECONÓMICA",
        "sa-number": "",
        "fecha-registro": "03/01/2022",
        "fecha-mod": "03/01/2022",
        "titulo": "CONCESION SUBV DIRECTA DISTRIBUCION ENERGÉTICA SAN ANTOLIN DE IBIAS",
        "titulo-cooficial": "",
        "inicio-solicitud": "01/01/2021",
        "fin-solicitud": "31/12/2021",
        "abierto": "0",
        "region": [
          "ES12 - PRINCIPADO DE ASTURIAS"
        ],
        "tipo-beneficiario": [
          {
            "codigo": "JSA",
            "descripcion": "PERSONAS JURÍDICAS QUE NO DESARROLLAN ACTIVIDAD ECONÓMICA"
          }
        ],
        "finalidad": {
          "codigo": "13",
          "descripcion": "INDUSTRIA Y ENERGÍA"
        },
        "instrumento": [
          {
            "codigo": "SUBV",
            "descripcion": "SUBVENCIÓN Y ENTREGA DINERARIA SIN CONTRAPRESTACIÓN "
          }
        ],
        "sector": [
          {
            "codigo": "D",
            "descripcion": "SUMINISTRO DE ENERGÍA ELÉCTRICA, GAS, VAPOR Y AIRE ACONDICIONADO"
          }
        ],
        "descripcionBR": "R.D. LEY 675/2014, DE 1 AGOSTO, BBRR AYUDAS PARA EL IMPULSO ECONOMICO COMARCAS MINERAS CARBON,",
        "URLespBR": "https://www.boe.es/boe/dias/2014/08/06/pdfs/BOE-A-2014-8494.pdf",
        "financiacion": [
          {
            "codigo": "PGE",
            "descripcion": "PRESUPUESTOS GENERALES DEL ESTADO",
            "importe": "375000"
          },
          {
            "codigo": "PCA",
            "descripcion": "PRESUPUESTOS GENERALES DE LAS COMUNIDADES AUTÓNOMAS",
            "importe": "106971"
          }
        ],
        "fondoUE": "",
        "permalink-convocatoria": "http://www.infosubvenciones.es/bdnstrans/GE/es/convocatoria/604387",
        "permalink-concesiones": "http://www.infosubvenciones.es/bdnstrans/GE/es/concesiones/convocatoria/604387"
      },
      "convocatoria - orden 5": {
        "codigo-BDNS": "604386",
        "mrr": "0",
        "dir3-organo": "A03028306",
        "desc-organo": "PRINCIPADO DE ASTURIAS - PRESIDENCIA DEL PRINCIPADO DE ASTURIAS",
        "sa-number": "",
        "fecha-registro": "03/01/2022",
        "fecha-mod": "03/01/2022",
        "titulo": "Subvenciones directas a diversos  Ayuntamientos del Principado de Asturias para el desarrollo del Plan Corresponsables",
        "titulo-cooficial": "",
        "inicio-solicitud": "28/04/2021",
        "fin-solicitud": "31/12/2021",
        "abierto": "0",
        "region": [
          "ES12 - PRINCIPADO DE ASTURIAS"
        ],
        "tipo-beneficiario": [
          {
            "codigo": "JSA",
            "descripcion": "PERSONAS JURÍDICAS QUE NO DESARROLLAN ACTIVIDAD ECONÓMICA"
          }
        ],
        "finalidad": {
          "codigo": "5",
          "descripcion": "SERVICIOS SOCIALES Y PROMOCIÓN SOCIAL"
        },
        "instrumento": [
          {
            "codigo": "SUBV",
            "descripcion": "SUBVENCIÓN Y ENTREGA DINERARIA SIN CONTRAPRESTACIÓN "
          }
        ],
        "sector": [
          {
            "codigo": "84.2",
            "descripcion": "Prestación de servicios a la comunidad en general"
          }
        ],
        "descripcionBR": "Ley del Principado de Asturias 3/2020, de 30 de diciembre, de Presupuestos Generales para 2021",
        "URLespBR": "https://sede.asturias.es/bopa-sumario?p_p_id=pa_sede_bopa_web_portlet_SedeBopaSummaryWeb&p_p_lifecycle=0&p_r_p_summaryDate=31/12/2020&p_r_p_summaryIsSearch=false",
        "financiacion": [
          {
            "codigo": "PGE",
            "descripcion": "PRESUPUESTOS GENERALES DEL ESTADO",
            "importe": "3000000"
          }
        ],
        "fondoUE": "",
        "permalink-convocatoria": "http://www.infosubvenciones.es/bdnstrans/GE/es/convocatoria/604386",
        "permalink-concesiones": "http://www.infosubvenciones.es/bdnstrans/GE/es/concesiones/convocatoria/604386"
      }
    }
  }
]

Hey @martinhache,

That will be it, the item is not an array it is just a JSON object. The good news is you should be able to just use the values with $json.convocatorias.xxx in the next node.

Was there something specific you were trying to do?

Hi @Jon and thanks for your help.

I am trying to insert data from an api into a Baserow table.

The workflow would be an approach like this:

And the result I’m looking for is this:

The only step I can’t manage to do is to separate the “convocatorias” object and split it into individual items to be inserted one by one into the Baserow table. :thinking:

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.