<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: How to transform a json array into a string list with nifi in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-transform-a-json-array-into-a-string-list-with-nifi/m-p/181989#M61592</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I think you can do that with EvaluateJsonPath extracting String in an JSON array, followed by UpdateAttribute removes special characters such as double quotes and square brackets by Expression Language.&lt;/P&gt;&lt;P&gt;Here is an example NiFi template that does above conversion:&lt;/P&gt;&lt;P&gt; &lt;A href="https://gist.github.com/ijokarumawak/bd37690ee8aa0bf8e9e2a47cf064e0d4" target="_blank" rel="nofollow noopener noreferrer"&gt;https://gist.github.com/ijokarumawak/bd37690ee8aa0bf8e9e2a47cf064e0d4&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="15654-json-array-to-string-list.png" style="width: 1596px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/19188iC57A92FDD21ADD7C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="15654-json-array-to-string-list.png" alt="15654-json-array-to-string-list.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 18 Aug 2019 08:57:18 GMT</pubDate>
    <dc:creator>kkawamura</dc:creator>
    <dc:date>2019-08-18T08:57:18Z</dc:date>
    <item>
      <title>How to transform a json array into a string list with nifi</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-transform-a-json-array-into-a-string-list-with-nifi/m-p/181987#M61590</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;i have a queryCassandra which generate a json like this one:&lt;/P&gt;&lt;PRE&gt;{"results":[{"term":"term1"},{"term":"term2"}..]} &lt;/PRE&gt;&lt;P&gt;Now, i want to get from this all the terms values separated by some separator in string format; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ex :
term1,term2,term3 &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;
So i can pass this list as a string parameter for a java main program which i've alreat set. &lt;/P&gt;&lt;P&gt;(i only need the transofrmation, not the java program execution)
Thank you !&lt;/P&gt;</description>
      <pubDate>Mon, 22 May 2017 22:22:45 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-transform-a-json-array-into-a-string-list-with-nifi/m-p/181987#M61590</guid>
      <dc:creator>adib_amine_mdr</dc:creator>
      <dc:date>2017-05-22T22:22:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to transform a json array into a string list with nifi</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-transform-a-json-array-into-a-string-list-with-nifi/m-p/181988#M61591</link>
      <description>&lt;P&gt;first you need to validate JSON data , you can use this tool &lt;A target="_blank" href="https://jsonformatter.org"&gt;JSON Formatter and JSON Validator&lt;/A&gt; &lt;/P&gt;</description>
      <pubDate>Tue, 23 May 2017 03:12:18 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-transform-a-json-array-into-a-string-list-with-nifi/m-p/181988#M61591</guid>
      <dc:creator>jimmi_prajapati</dc:creator>
      <dc:date>2017-05-23T03:12:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to transform a json array into a string list with nifi</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-transform-a-json-array-into-a-string-list-with-nifi/m-p/181989#M61592</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I think you can do that with EvaluateJsonPath extracting String in an JSON array, followed by UpdateAttribute removes special characters such as double quotes and square brackets by Expression Language.&lt;/P&gt;&lt;P&gt;Here is an example NiFi template that does above conversion:&lt;/P&gt;&lt;P&gt; &lt;A href="https://gist.github.com/ijokarumawak/bd37690ee8aa0bf8e9e2a47cf064e0d4" target="_blank" rel="nofollow noopener noreferrer"&gt;https://gist.github.com/ijokarumawak/bd37690ee8aa0bf8e9e2a47cf064e0d4&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="15654-json-array-to-string-list.png" style="width: 1596px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/19188iC57A92FDD21ADD7C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="15654-json-array-to-string-list.png" alt="15654-json-array-to-string-list.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 08:57:18 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-transform-a-json-array-into-a-string-list-with-nifi/m-p/181989#M61592</guid>
      <dc:creator>kkawamura</dc:creator>
      <dc:date>2019-08-18T08:57:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to transform a json array into a string list with nifi</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-transform-a-json-array-into-a-string-list-with-nifi/m-p/181990#M61593</link>
      <description>&lt;P&gt;thanks &lt;A rel="user" href="https://community.cloudera.com/users/3908/kkawamura.html" nodeid="3908"&gt;@kkawamura&lt;/A&gt;! a last question, how can i get the flowfile generated as &lt;STRONG&gt;ex : term1,term2,term3 &lt;/STRONG&gt;as a parameter in the next processor? &lt;/P&gt;</description>
      <pubDate>Tue, 23 May 2017 16:45:23 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-transform-a-json-array-into-a-string-list-with-nifi/m-p/181990#M61593</guid>
      <dc:creator>adib_amine_mdr</dc:creator>
      <dc:date>2017-05-23T16:45:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to transform a json array into a string list with nifi</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-transform-a-json-array-into-a-string-list-with-nifi/m-p/181991#M61594</link>
      <description>&lt;P&gt;You mean how to map the attribute value (term1,term2,term3) to FlowFile content? If so, I'd use ReplaceText processor, set Replacement Value as "${attribute-name}" and Replacement Strategy as "Always Replace".&lt;/P&gt;</description>
      <pubDate>Tue, 23 May 2017 18:45:44 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-transform-a-json-array-into-a-string-list-with-nifi/m-p/181991#M61594</guid>
      <dc:creator>kkawamura</dc:creator>
      <dc:date>2017-05-23T18:45:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to transform a json array into a string list with nifi</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-transform-a-json-array-into-a-string-list-with-nifi/m-p/361183#M61595</link>
      <description>&lt;P&gt;In my case I have to fetch a particular key value from a json array. I was trying to do $.[key] but it just splits the array into separate json files. Is there any solution for this ? I wanted the split array as {"test1", "test2"}&lt;/P&gt;&lt;P&gt;Jsonarray example: [{"key":"test1", "name":"testName"}, {"key":"test2", "name":"testName2"}]&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jan 2023 21:03:50 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-transform-a-json-array-into-a-string-list-with-nifi/m-p/361183#M61595</guid>
      <dc:creator>Scorpy257</dc:creator>
      <dc:date>2023-01-12T21:03:50Z</dc:date>
    </item>
  </channel>
</rss>

