<?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 NiFi: split response json for a subsequent http request in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-split-response-json-for-a-subsequent-http-request/m-p/211409#M71986</link>
    <description>&lt;P&gt;I need to read an API where my first call will return a JSON with objectIDs in this form:&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;UL&gt;
&lt;LI&gt;objectIdFieldName: "ID",
&lt;/LI&gt;&lt;LI&gt;objectIds: [&lt;UL&gt;&lt;LI&gt;64916,
&lt;/LI&gt;&lt;LI&gt;67266,
&lt;/LI&gt;&lt;LI&gt;67237,
&lt;/LI&gt;&lt;LI&gt;64511, &lt;/LI&gt;&lt;LI&gt;....&lt;/LI&gt;&lt;LI&gt;..]&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;I need to use the objectIds above to send requests for each of these IDs to the API that will return the data that i need.&lt;/P&gt;&lt;P&gt;I was thinking a flow:&lt;/P&gt;&lt;P&gt;GetHTTP (get response JSON) --&amp;gt; EvaluateJSONpath (parse only objectIds field: $.objectIds) --&amp;gt; ? --&amp;gt; InvokeHTTP (new query per ID)&lt;/P&gt;&lt;P&gt;My problem comes after that as what i get is a sort of objectIds array in the form of:&lt;/P&gt;&lt;P&gt;[64916, 67266, 67237, 64511,...,]&lt;/P&gt;&lt;P&gt;How to i manage to split/parse each ID  from this array in a flowfile attribute so that i can send it along with other data/headers to the InvokeHTTP processor?&lt;/P&gt;&lt;P&gt;I thought to use SplitJson processor but i am having difficulties to understand its usage in this case.&lt;/P&gt;&lt;P&gt;Any help much appreciated!&lt;/P&gt;&lt;P style="margin-left: 20px;"&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 30 Nov 2017 00:19:10 GMT</pubDate>
    <dc:creator>foivos</dc:creator>
    <dc:date>2017-11-30T00:19:10Z</dc:date>
    <item>
      <title>NiFi: split response json for a subsequent http request</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-split-response-json-for-a-subsequent-http-request/m-p/211409#M71986</link>
      <description>&lt;P&gt;I need to read an API where my first call will return a JSON with objectIDs in this form:&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;UL&gt;
&lt;LI&gt;objectIdFieldName: "ID",
&lt;/LI&gt;&lt;LI&gt;objectIds: [&lt;UL&gt;&lt;LI&gt;64916,
&lt;/LI&gt;&lt;LI&gt;67266,
&lt;/LI&gt;&lt;LI&gt;67237,
&lt;/LI&gt;&lt;LI&gt;64511, &lt;/LI&gt;&lt;LI&gt;....&lt;/LI&gt;&lt;LI&gt;..]&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;I need to use the objectIds above to send requests for each of these IDs to the API that will return the data that i need.&lt;/P&gt;&lt;P&gt;I was thinking a flow:&lt;/P&gt;&lt;P&gt;GetHTTP (get response JSON) --&amp;gt; EvaluateJSONpath (parse only objectIds field: $.objectIds) --&amp;gt; ? --&amp;gt; InvokeHTTP (new query per ID)&lt;/P&gt;&lt;P&gt;My problem comes after that as what i get is a sort of objectIds array in the form of:&lt;/P&gt;&lt;P&gt;[64916, 67266, 67237, 64511,...,]&lt;/P&gt;&lt;P&gt;How to i manage to split/parse each ID  from this array in a flowfile attribute so that i can send it along with other data/headers to the InvokeHTTP processor?&lt;/P&gt;&lt;P&gt;I thought to use SplitJson processor but i am having difficulties to understand its usage in this case.&lt;/P&gt;&lt;P&gt;Any help much appreciated!&lt;/P&gt;&lt;P style="margin-left: 20px;"&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Nov 2017 00:19:10 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-split-response-json-for-a-subsequent-http-request/m-p/211409#M71986</guid>
      <dc:creator>foivos</dc:creator>
      <dc:date>2017-11-30T00:19:10Z</dc:date>
    </item>
    <item>
      <title>Re: NiFi: split response json for a subsequent http request</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-split-response-json-for-a-subsequent-http-request/m-p/211410#M71987</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/24249/foivos.html" nodeid="24249" target="_blank"&gt;@balalaika&lt;/A&gt;&lt;P&gt;Use &lt;STRONG&gt;SplitJson&lt;/STRONG&gt; Processor with the following configs:-&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="42794-split.png" style="width: 634px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/16661i9C32B50DA90FC17D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="42794-split.png" alt="42794-split.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Input Json:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;{
"objectIdFieldName": "ID",
"objectIds": [
64916,
67266,
67237,
64511]
}&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Output:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;will be different flowfiles per objectId&lt;/P&gt;&lt;PRE&gt;64916&lt;/PRE&gt;&lt;PRE&gt;67266&lt;/PRE&gt;&lt;PRE&gt;67237&lt;/PRE&gt;&lt;PRE&gt;64511&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Use Extract Text processor:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="42795-extracttext.png" style="width: 641px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/16662i92FA37B9B536F6E4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="42795-extracttext.png" alt="42795-extracttext.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;extract the content of the flowfile by adding new property&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;id&lt;/STRONG&gt; as&lt;/P&gt;&lt;PRE&gt;(.*)&lt;/PRE&gt;&lt;P&gt;Right now you will have&lt;STRONG&gt; id attribute added to the flowfile &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;then you can use the &lt;STRONG&gt;id &lt;/STRONG&gt;attribute when you are doing &lt;STRONG&gt;InvokeHTTP&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;GetHTTP (get response JSON) --&amp;gt; SplitJson --&amp;gt;ExtractText--&amp;gt; InvokeHTTP (new query per ID)&lt;/PRE&gt;</description>
      <pubDate>Sun, 18 Aug 2019 03:58:39 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-split-response-json-for-a-subsequent-http-request/m-p/211410#M71987</guid>
      <dc:creator>Shu_ashu</dc:creator>
      <dc:date>2019-08-18T03:58:39Z</dc:date>
    </item>
  </channel>
</rss>

