Using aggregate input in json to create an html code

Hello this is my configuration :

i m on premise :

  • n8n version: : 1.64.3
  • Database (default: SQLite): Postgress
  • n8n EXECUTIONS_PROCESS setting (default: own, main): : default
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: : Debian 12

My probléme is how to acces to my data in code javascript :

My workflow look at XML files and get out some data from it :

now i get this data and i want create an html form to send it, but teams or mail
i m stuck on the data organisation

i can extract my data in XML but how i can use them in code and make a foreach to get them on a html table

this is the json :

[
  {
    "Document": {
      "donnee": {
        "info001": {
          "valeur001": "10.00"
        },
        "infoDate": {
          "date": "2024-11-01"
        }
      }
    },
    "NomFichier": "files01.xml"
  },
  {
    "Document": {
      "donnee": {
        "info001": {
          "valeur001": "11.00"
        },
        "infoDate": {
          "date": "2024-11-01"
        }
      }
    },
    "NomFichier": "files02.xml"
  },
  {
    "Document": {
      "donnee": {
        "info001": {
          "valeur001": "12.00"
        },
        "infoDate": {
          "date": "2024-11-01"
        }
      }
    },
    "NomFichier": "file03.xml"
  },
  {
    "Document": {
      "donnee": {
        "info001": {
          "valeur001": "13.00"
        },
        "infoDate": {
          "date": "2024-11-01"
        }
      }
    },
    "NomFichier": "file04.xml"
  }
]

can u have some exemple please to using date form the output of a node to a code

thanks

Hi @Issa2024,
if you want to convert your data to an HTML table you can use a sequence of these nodes:

  • Convert to File (operation Convert to HTML): this converts the JSON data to an HTML file with a table in it
  • Extract from File (operation: extract from text): this will actually extract the HTML code out of the file
  • HTML (operation: Extract HTML content):; this can extract only the table out of the whole HTML page

See this workflow as an example:

Your original data has nested fields that aren’t represented easily in a table, I suggest manipulating your data to come with a flat JSON (without nested fields). See the branch with the “Flat JSON” node in the example.

Hope this helps :slight_smile:

2 Likes

works perfetcly thanks :slight_smile:

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