Hi Nifi Community,

I have situation where I need to merge JSON content from multiple flowfiles
into one JSON content (single flowfile).

JSON in every flowfile looks like this:

{
  "analyses": "prep_array",
  "args": "prep_array",
  "scriptId": "142",
  "libIds": "141",
  "job_name": "my_demo_job",
  "project_id": "23",
  "configId": "5",
  "file_id": "150",
  "analysis_name": "my_analysis_name",
  "source_id": "12",
  "customer_id": "16"
}

and every flowfile has only one filed different from the others, that is
file_id. I want to merge it all in one JSON but to get this structure:

{
  "analyses": "prep_array",
  "args": "prep_array",
  "scriptId": "142",
  "libIds": "141",
  "job_name": "my_demo_job",
  "project_id": "23",
  "configId": "5",
  "file_id": [
    150,
    151,
    152,
    153,
    154
  ],
  "analysis_name": "my_analysis_name",
  "source_id": "12",
  "customer_id": "16"
}

What is the best way to do it? It sounds to me a little bit tricky, but I
hope I'm wrong.

Please can someone give me advice or some guidelines?

Thanks in advance,
Tom

Reply via email to