From json to a table

Hi,

i have a json string, which described as following

I want to build an array or table which looks like this

image

How could i do that?

Hi @Roland_Schnurr,

Can you share a bit more of the data?

Do you need an array or a table? If it’s a table, it’s going to be csv?

It will help if you share also the incoming data structure, so I could make a couple of tests.

Thank you

Hi Giacomo,

what i want to do with the json.

  1. I want to build a table like this, to put it into a google docs

  1. I want to send the data, table, array in a prompt to claude sonnet to get an analysis.

AA - anzahlrichtig - 34

Can you share a copy of the json output from the module?
Thank you

{
  "nutzer": {
    "ergebnisuservalidieren": [
      "user: values@sixsigmablackbelt -> valid; msa7-> valid; licence key = asdfasdfsb -> valid; date of licence; (2025-08-07) greater than today (2024-08-21) -> valid; calculation at 2024-08-21 23:29:25.37085; note: Rapi"
    ],
    "ergebnisuservalidieren_status": [
      "ja"
    ],
    "Lizenzdatum": [
      "07.08.2025"
    ],
    "Notiz": [
      "Rapi"
    ]
  },
  "daten": {
    "AA": {
      "K": [
        0.76
      ],
      "anzahlrichtig": [
        42
      ],
      "anzahlgeprueft": [
        50
      ],
      "prozentrichtig": [
        0.84
      ],
      "ci_lower": [
        0.7089
      ],
      "ci_upper": [
        0.9283
      ]
    },
    "BB": {
      "K": [
        0.8451
      ],
      "anzahlrichtig": [
        45
      ],
      "anzahlgeprueft": [
        50
      ],
      "prozentrichtig": [
        0.9
      ],
      "ci_lower": [
        0.7819
      ],
      "ci_upper": [
        0.9667
      ]
    },
    "CC": {
      "K": [
        0.7029
      ],
      "anzahlrichtig": [
        40
      ],
      "anzahlgeprueft": [
        50
      ],
      "prozentrichtig": [
        0.8
      ],
      "ci_lower": [
        0.6628
      ],
      "ci_upper": [
        0.8997
      ]
    },
    "PP": {
      "K": [
        0.7936
      ],
      "anzahlrichtig": [
        39
      ],
      "anzahlgeprueft": [
        50
      ],
      "prozentrichtig": [
        0.78
      ],
      "ci_lower": [
        0.6404
      ],
      "ci_upper": [
        0.8847
      ]
    },
    "AR": {
      "K": [
        0.8802
      ],
      "anzahlrichtig": [
        42
      ],
      "anzahlgeprueft": [
        50
      ],
      "prozentrichtig": [
        0.84
      ],
      "ci_lower": [
        0.7089
      ],
      "ci_upper": [
        0.9283
      ]
    },
    "BR": {
      "K": [
        0.9226
      ],
      "anzahlrichtig": [
        45
      ],
      "anzahlgeprueft": [
        50
      ],
      "prozentrichtig": [
        0.9
      ],
      "ci_lower": [
        0.7819
      ],
      "ci_upper": [
        0.9667
      ]
    },
    "CR": {
      "K": [
        0.7747
      ],
      "anzahlrichtig": [
        40
      ],
      "anzahlgeprueft": [
        50
      ],
      "prozentrichtig": [
        0.8
      ],
      "ci_lower": [
        0.6628
      ],
      "ci_upper": [
        0.8997
      ]
    },
    "PR": {
      "K": [
        0.8592
      ],
      "anzahlrichtig": [
        39
      ],
      "anzahlgeprueft": [
        50
      ],
      "prozentrichtig": [
        0.78
      ],
      "ci_lower": [
        0.6404
      ],
      "ci_upper": [
        0.8847
      ]
    }
  }
}

i just need the data in “daten”.

I’ll probably do it this way, I’m sure there are better solutions.

You’ll need a minimum of four modules:

Output

This is just an example. Your final solution may or may not look like this depending on your requirements.

Module Export - quick import into your scenario

You can copy and paste this module export into your scenario. This will import the modules (with fields/settings/filters) shown in my screenshots above.

  1. Move your mouse over the line of code below. Copy the JSON by clicking the copy button on the right of the code, which looks like this:

  2. Enter your scenario editor. Press ESC to close any dialogs. Press CTRLV (paste keyboard shortcut for Windows) to paste directly in the editor.

  3. Click on each imported module and re-save it for validation. There may be some errors prompting you to remap some variables and connections.

JSON module export — paste this directly in your scenario

{"subflows":[{"flow":[{"id":266,"module":"json:ParseJSON","version":1,"parameters":{"type":""},"mapper":{"json":"{\"daten\":{\"AA\":{\"K\":[0.76],\"anzahlrichtig\":[42],\"anzahlgeprueft\":[50],\"prozentrichtig\":[0.84],\"ci_lower\":[0.7089],\"ci_upper\":[0.9283]},\"BB\":{\"K\":[0.8451],\"anzahlrichtig\":[45],\"anzahlgeprueft\":[50],\"prozentrichtig\":[0.9],\"ci_lower\":[0.7819],\"ci_upper\":[0.9667]},\"CC\":{\"K\":[0.7029],\"anzahlrichtig\":[40],\"anzahlgeprueft\":[50],\"prozentrichtig\":[0.8],\"ci_lower\":[0.6628],\"ci_upper\":[0.8997]},\"PP\":{\"K\":[0.7936],\"anzahlrichtig\":[39],\"anzahlgeprueft\":[50],\"prozentrichtig\":[0.78],\"ci_lower\":[0.6404],\"ci_upper\":[0.8847]},\"AR\":{\"K\":[0.8802],\"anzahlrichtig\":[42],\"anzahlgeprueft\":[50],\"prozentrichtig\":[0.84],\"ci_lower\":[0.7089],\"ci_upper\":[0.9283]},\"BR\":{\"K\":[0.9226],\"anzahlrichtig\":[45],\"anzahlgeprueft\":[50],\"prozentrichtig\":[0.9],\"ci_lower\":[0.7819],\"ci_upper\":[0.9667]},\"CR\":{\"K\":[0.7747],\"anzahlrichtig\":[40],\"anzahlgeprueft\":[50],\"prozentrichtig\":[0.8],\"ci_lower\":[0.6628],\"ci_upper\":[0.8997]},\"PR\":{\"K\":[0.8592],\"anzahlrichtig\":[39],\"anzahlgeprueft\":[50],\"prozentrichtig\":[0.78],\"ci_lower\":[0.6404],\"ci_upper\":[0.8847]}}}"},"metadata":{"designer":{"x":1130,"y":-2089},"parameters":[{"name":"type","type":"udt","label":"Data structure"}]}},{"id":270,"module":"util:SetVariable2","version":1,"parameters":{},"mapper":{"name":"array","scope":"roundtrip","value":"{{toArray(266.daten)}}"},"metadata":{"designer":{"x":1375,"y":-2086,"name":"Convert Data to Array"}}},{"id":267,"module":"builtin:BasicFeeder","version":1,"parameters":{},"mapper":{"array":"{{keys(266.daten.AA)}}"},"metadata":{"designer":{"x":1620,"y":-2086,"name":"Iterate Keys"}}},{"id":269,"module":"util:TextAggregator","version":1,"parameters":{"rowSeparator":"\n","feeder":267},"mapper":{"value":"{{267.value}};{{join(map(270.array; \"value.\" + 267.value + \".1\"); \";\")}}"},"metadata":{"designer":{"x":1866,"y":-2086,"name":"Build CSV"},"parameters":[{"name":"rowSeparator","type":"select","label":"Row separator","validate":{"enum":["\n","\t","other"]}}],"advanced":true}},{"id":271,"module":"csv:ParseCSV","version":1,"parameters":{"colCount":null,"csvContainsHeaders":false,"delimiterType":"other","relax":false,"delimiter":";"},"mapper":{"csv":"{{269.text}}"},"metadata":{"designer":{"x":2118,"y":-2090,"name":"Parse CSV"},"parameters":[{"name":"colCount","type":"number","label":"Number of columns"},{"name":"csvContainsHeaders","type":"boolean","label":"CSV contains headers","required":true},{"name":"delimiterType","type":"select","label":"Delimiter","required":true,"validate":{"enum":[",","\t","other"]}},{"name":"relax","type":"boolean","label":"Preserve quotes inside unquoted field","required":true},{"name":"delimiter","type":"text","label":"Delimiter character","validate":{"max":1,"min":1},"required":true}]}}]}],"metadata":{"version":1}}

Note: Did you know you can reduce the size of blueprints and module export code like the above, using the Make Blueprint Scrubber?

Hope this helps! Let me know if there are any further questions or issues.

— @samliew


P.S.: Did you know, the concepts of about 70% of questions asked on this forum are already covered in the Make Academy. Investing some effort into it will save you lots of time and frustration using Make later!

2 Likes

Hi samliew,
thanks for your suggestions.
It works till this point.

Is there a possibility to get the “keys” into the first row of the text?

image

as described below

pruefer;AA;BB;CC;PP;AR;BR;CR;PR
Kappa;0.76;0.8451;0.7029;0.7936;0.8802;0.9226;0.7747;0.8592
anzahlrichtig;42;45;40;39;42;45;40;39
anzahlgeprueft;50;50;50;50;50;50;50;50
prozentrichtig;0.84;0.9;0.8;0.78;0.84;0.9;0.8;0.78
Konfidenzintervall unten;0.7089;0.7819;0.6628;0.6404;0.7089;0.7819;0.6628;0.6404
ci_upper;0.9283;0.9667;0.8997;0.8847;0.9283;0.9667;0.8997;0.8

@samliew solution only parses and converts daten.AA from your original JSON. You’ll see that in module 3 called Iterate Keys where he is working through the first data set labeled AA. You will need to build out another iterator before that to work through all the data sets from the original JSON and then you can save each high level key “pruefer” into a string which you can append to the top of your CSV structure before it is parsed by Parse CSV.

1 Like

Yes it’s possible, like what Alex says.

Hi,
thanks both for your support. The solution worked.

1 Like