<?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 Once I split a JSON Array, how to use each spplited JSON object to call an HTTP GET response ? in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Once-I-split-a-JSON-Array-how-to-use-each-spplited-JSON/m-p/232975#M79886</link>
    <description>&lt;P&gt;I'm issuing the following URL by using a GetHTTP processor named "States", whose &lt;STRONG&gt;URL&lt;/STRONG&gt; property - &lt;STRONG&gt;${DOMAIN}&lt;/STRONG&gt; is omitted for issues of brevity - is&lt;/P&gt;&lt;P&gt;    &lt;STRONG&gt;&lt;A href="http://${DOMAIN}/api/states" target="_blank"&gt;http://${DOMAIN}/api/states&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;which gives me the following results&lt;/P&gt;&lt;PRE&gt;[
    {
        id: 1,
        name: "Alabama"
    },
    {
        id: 2,
        name: "California"
    }
...
]
&lt;/PRE&gt;&lt;P&gt;Then I split the array by using a SplitJson processor "Split by state", whose &lt;STRONG&gt;JsonPathExpression&lt;/STRONG&gt; property is&lt;/P&gt;&lt;P&gt;    $.*&lt;/P&gt;&lt;P&gt;so that I can fetch each object of the array shown above. Next, I use a AttributesToJSON to map the property id to a state flowfile-attribute, as below&lt;/P&gt;&lt;P&gt;    Destination - flowfile-attribute&lt;/P&gt;&lt;P&gt;    &lt;STRONG&gt;state&lt;/STRONG&gt;           - $.id&lt;/P&gt;&lt;P&gt;Now, for each spplited JSON object, I want to issue a new GET HTTP called "Municipalities by state" in the form of &lt;STRONG&gt;&lt;A href="http://${DOMAIN}/api/states/${state}/municipalities" target="_blank"&gt;http://${DOMAIN}/api/states/${state}/municipalities&lt;/A&gt;&lt;/STRONG&gt;. However, NiFi doesn't allow me "connect" the AttibutesToJson to an GetHttp processor. So What should I do to enable the GetHttp processor "Municipalities by state" ?&lt;/P&gt;</description>
    <pubDate>Tue, 26 Jun 2018 03:41:42 GMT</pubDate>
    <dc:creator>arthurseveral</dc:creator>
    <dc:date>2018-06-26T03:41:42Z</dc:date>
    <item>
      <title>Once I split a JSON Array, how to use each spplited JSON object to call an HTTP GET response ?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Once-I-split-a-JSON-Array-how-to-use-each-spplited-JSON/m-p/232975#M79886</link>
      <description>&lt;P&gt;I'm issuing the following URL by using a GetHTTP processor named "States", whose &lt;STRONG&gt;URL&lt;/STRONG&gt; property - &lt;STRONG&gt;${DOMAIN}&lt;/STRONG&gt; is omitted for issues of brevity - is&lt;/P&gt;&lt;P&gt;    &lt;STRONG&gt;&lt;A href="http://${DOMAIN}/api/states" target="_blank"&gt;http://${DOMAIN}/api/states&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;which gives me the following results&lt;/P&gt;&lt;PRE&gt;[
    {
        id: 1,
        name: "Alabama"
    },
    {
        id: 2,
        name: "California"
    }
...
]
&lt;/PRE&gt;&lt;P&gt;Then I split the array by using a SplitJson processor "Split by state", whose &lt;STRONG&gt;JsonPathExpression&lt;/STRONG&gt; property is&lt;/P&gt;&lt;P&gt;    $.*&lt;/P&gt;&lt;P&gt;so that I can fetch each object of the array shown above. Next, I use a AttributesToJSON to map the property id to a state flowfile-attribute, as below&lt;/P&gt;&lt;P&gt;    Destination - flowfile-attribute&lt;/P&gt;&lt;P&gt;    &lt;STRONG&gt;state&lt;/STRONG&gt;           - $.id&lt;/P&gt;&lt;P&gt;Now, for each spplited JSON object, I want to issue a new GET HTTP called "Municipalities by state" in the form of &lt;STRONG&gt;&lt;A href="http://${DOMAIN}/api/states/${state}/municipalities" target="_blank"&gt;http://${DOMAIN}/api/states/${state}/municipalities&lt;/A&gt;&lt;/STRONG&gt;. However, NiFi doesn't allow me "connect" the AttibutesToJson to an GetHttp processor. So What should I do to enable the GetHttp processor "Municipalities by state" ?&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jun 2018 03:41:42 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Once-I-split-a-JSON-Array-how-to-use-each-spplited-JSON/m-p/232975#M79886</guid>
      <dc:creator>arthurseveral</dc:creator>
      <dc:date>2018-06-26T03:41:42Z</dc:date>
    </item>
    <item>
      <title>Re: Once I split a JSON Array, how to use each spplited JSON object to call an HTTP GET response ?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Once-I-split-a-JSON-Array-how-to-use-each-spplited-JSON/m-p/232976#M79887</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/84271/arthurseveral.html" nodeid="84271"&gt;@Ferrero Rocher&lt;/A&gt;&lt;P&gt;Use &lt;STRONG&gt;InvokeHTTP &lt;/STRONG&gt;processor which allows incoming connections &lt;STRONG&gt;instead &lt;/STRONG&gt;of &lt;STRONG&gt;GetHTTP &lt;/STRONG&gt;processor&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Flow:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;1.GetHTTP&lt;BR /&gt;2.SplitJson //split array $.*&lt;BR /&gt;3.EvaluateJsonPath //to extract id value and keep as state attribute&lt;BR /&gt;4.InvokeHTTP //http://${DOMAIN}/api/states/${state}/municipalities&lt;/PRE&gt;</description>
      <pubDate>Tue, 26 Jun 2018 05:09:00 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Once-I-split-a-JSON-Array-how-to-use-each-spplited-JSON/m-p/232976#M79887</guid>
      <dc:creator>Shu_ashu</dc:creator>
      <dc:date>2018-06-26T05:09:00Z</dc:date>
    </item>
  </channel>
</rss>

