<?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>topic Re: How to separate json array elements in separate json outputs? in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/How-to-separate-json-array-elements-in-separate-json-outputs/m-p/2220390#M14809</link>
    <description>&lt;P&gt;Hi Shong,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am very new to Talend.&amp;nbsp; Can you please give an example I could use to learn from?&amp;nbsp; An example would help in learning the flow I should have.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 24 Dec 2019 11:34:03 GMT</pubDate>
    <dc:creator>adbdkb</dc:creator>
    <dc:date>2019-12-24T11:34:03Z</dc:date>
    <item>
      <title>How to separate json array elements in separate json outputs?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-separate-json-array-elements-in-separate-json-outputs/m-p/2220388#M14807</link>
      <description>&lt;P&gt;I have an input json file that contains array elements for an object.&amp;nbsp; The number of elements in the array varies from 0 to a max of 15.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I need to create as many output jsons as there are elements in the array.&amp;nbsp; Each output will also contain common elements from the input json.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Is it possible to create multiple outputs - each containing one element of the array?&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;STRONG&gt;Input JSON&lt;/STRONG&gt;&lt;/P&gt; 
&lt;PRE&gt;{
  "id" : "c064e784-5d3b-4d78-9451-eae608ad66a9",
  "format" : "AVRO",
  "EventMessage" : {
    "SourceSystem" : {
      "eventOccurredTime" : "10-04-0009",
      "id" : 1,
      "name" : "FAST",
      "sourceCorrelationId" : "bac5de63-ba46-4aaf-a508-101f41a22d1e"
    },
    "Domain" : {
      "id" : 1,
      "name" : "Policy",
      "type" : "Raw"
    },
    "EventAttributes" : {
      "id" : "522533ce-fe82-4e73-bfbc-52cacb2c7903",
      "msgType" : "Raw",
      "correlationId" : "bac5de63-ba46-4aaf-a508-101f41a22d1e",
      "eventCreatedTime" : "10-06-0016",
      "eventName" : "PolicyFinancialTrx",
      "parentEventName" : "FastFinancialTrx",
      "parentEventOccurredTime" : "10-04-0009",
      "DataElements" : {
        "TrxHdrDisburse" : {
          "TaxDtl" : [ {
            "ID" : "d42f00f2-2f70-4fed-bcb3-035b2d1febbd",
            "DisbHdrID" : "f3b1ee06-fe01-470d-ae59-e1372788d11b",
            "DeductionType" : "FederalTax",
            "TaxDedPct" : "0",
            "TaxDedAmt" : "0",
            "TaxableGain" : "0",
            "WithholdAmt" : "0",
            "TaxDtlParty" : {
              "TaxDtlID" : "d42f00f2-2f70-4fed-bcb3-035b2d1febbd",
              "PartyID" : "260bebec-d70f-4d69-b702-817e12acffbe",
              "CustomerProfileGUID" : "260bebec-d70f-4d69-b702-817e12acffbe",
              "BeneficiaryGUID" : "260bebec-d70f-4d69-b702-817e12acffbe"
            }
          }, {
            "ID" : "eb333766-51fa-4b0c-99a8-a30c0379d454",
            "DisbHdrID" : "f3b1ee06-fe01-470d-ae59-e1372788d11b",
            "DeductionType" : "StateTax",
            "TaxDedPct" : "0",
            "TaxDedAmt" : "0",
            "TaxableGain" : "0",
            "WithholdAmt" : "0",
            "TaxDtlParty" : {
              "TaxDtlID" : "eb333766-51fa-4b0c-99a8-a30c0379d454",
              "PartyID" : "260bebec-d70f-4d69-b702-817e12acffbe",
              "CustomerProfileGUID" : "260bebec-d70f-4d69-b702-817e12acffbe",
              "BeneficiaryGUID" : "260bebec-d70f-4d69-b702-817e12acffbe"
            }
          } ]
      }
    }
  }
}&lt;/PRE&gt; 
&lt;P&gt;&lt;STRONG&gt;Expected Outputs - One per array element&lt;/STRONG&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;{
  "id" : "c064e784-5d3b-4d78-9451-eae608ad66a9",
  "format" : "AVRO",
  "EventMessage" : {
    "SourceSystem" : {
      "eventOccurredTime" : "10-04-0009",
      "id" : 1,
      "name" : "FAST",
      "sourceCorrelationId" : "bac5de63-ba46-4aaf-a508-101f41a22d1e"
    },
    "Domain" : {
      "id" : 1,
      "name" : "Policy",
      "type" : "Raw"
    },
    "EventAttributes" : {
      "id" : "522533ce-fe82-4e73-bfbc-52cacb2c7903",
      "msgType" : "Raw",
      "correlationId" : "bac5de63-ba46-4aaf-a508-101f41a22d1e",
      "eventCreatedTime" : "10-06-0016",
      "eventName" : "PolicyFinancialTrx",
      "parentEventName" : "FastFinancialTrx",
      "parentEventOccurredTime" : "10-04-0009",
      "DataElements" : {
        "TrxHdrDisburse" : {
          "TaxDtl" : {
            "ID" : "d42f00f2-2f70-4fed-bcb3-035b2d1febbd",
            "DisbHdrID" : "f3b1ee06-fe01-470d-ae59-e1372788d11b",
            "DeductionType" : "FederalTax",
            "TaxDedPct" : "0",
            "TaxDedAmt" : "0",
            "TaxableGain" : "0",
            "WithholdAmt" : "0",
            "TaxDtlParty" : {
              "TaxDtlID" : "d42f00f2-2f70-4fed-bcb3-035b2d1febbd",
              "PartyID" : "260bebec-d70f-4d69-b702-817e12acffbe",
              "CustomerProfileGUID" : "260bebec-d70f-4d69-b702-817e12acffbe",
              "BeneficiaryGUID" : "260bebec-d70f-4d69-b702-817e12acffbe"
            }
          }
        }
      }
    }
  }
}&lt;/PRE&gt; 
&lt;P&gt;&lt;STRONG&gt;AND&lt;/STRONG&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;{
  "id" : "c064e784-5d3b-4d78-9451-eae608ad66a9",
  "format" : "AVRO",
  "EventMessage" : {
    "SourceSystem" : {
      "eventOccurredTime" : "10-04-0009",
      "id" : 1,
      "name" : "FAST",
      "sourceCorrelationId" : "bac5de63-ba46-4aaf-a508-101f41a22d1e"
    },
    "Domain" : {
      "id" : 1,
      "name" : "Policy",
      "type" : "Raw"
    },
    "EventAttributes" : {
      "id" : "522533ce-fe82-4e73-bfbc-52cacb2c7903",
      "msgType" : "Raw",
      "correlationId" : "bac5de63-ba46-4aaf-a508-101f41a22d1e",
      "eventCreatedTime" : "10-06-0016",
      "eventName" : "PolicyFinancialTrx",
      "parentEventName" : "FastFinancialTrx",
      "parentEventOccurredTime" : "10-04-0009",
      "DataElements" : {
        "TrxHdrDisburse" : {
          "TaxDtl" :  {
            "ID" : "eb333766-51fa-4b0c-99a8-a30c0379d454",
            "DisbHdrID" : "f3b1ee06-fe01-470d-ae59-e1372788d11b",
            "DeductionType" : "StateTax",
            "TaxDedPct" : "0",
            "TaxDedAmt" : "0",
            "TaxableGain" : "0",
            "WithholdAmt" : "0",
            "TaxDtlParty" : {
              "TaxDtlID" : "eb333766-51fa-4b0c-99a8-a30c0379d454",
              "PartyID" : "260bebec-d70f-4d69-b702-817e12acffbe",
              "CustomerProfileGUID" : "260bebec-d70f-4d69-b702-817e12acffbe",
              "BeneficiaryGUID" : "260bebec-d70f-4d69-b702-817e12acffbe"
            }
          } 
        }
      }
    }
  }
}&lt;/PRE&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 18 Dec 2019 00:36:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-separate-json-array-elements-in-separate-json-outputs/m-p/2220388#M14807</guid>
      <dc:creator>adbdkb</dc:creator>
      <dc:date>2019-12-18T00:36:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to separate json array elements in separate json outputs?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-separate-json-array-elements-in-separate-json-outputs/m-p/2220389#M14808</link>
      <description>Hi 
&lt;BR /&gt;It is easy to extract all elements from the array, and then iterate each record and create a separate json file for each record. 
&lt;BR /&gt; 
&lt;BR /&gt;Regards 
&lt;BR /&gt;Shong 
&lt;BR /&gt; 
&lt;BR /&gt;</description>
      <pubDate>Tue, 24 Dec 2019 04:32:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-separate-json-array-elements-in-separate-json-outputs/m-p/2220389#M14808</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-12-24T04:32:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to separate json array elements in separate json outputs?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-separate-json-array-elements-in-separate-json-outputs/m-p/2220390#M14809</link>
      <description>&lt;P&gt;Hi Shong,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am very new to Talend.&amp;nbsp; Can you please give an example I could use to learn from?&amp;nbsp; An example would help in learning the flow I should have.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Dec 2019 11:34:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-separate-json-array-elements-in-separate-json-outputs/m-p/2220390#M14809</guid>
      <dc:creator>adbdkb</dc:creator>
      <dc:date>2019-12-24T11:34:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to separate json array elements in separate json outputs?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-separate-json-array-elements-in-separate-json-outputs/m-p/2220391#M14810</link>
      <description>The job design looks like:
&lt;BR /&gt;tFileInputJson--tLogRow--main--tFlowToIterate--iterate--tIterateToFlow-main-tWriteJsonField--main--tFileOutputDelimited.
&lt;BR /&gt;
&lt;BR /&gt;Please learn these components and test each step. Let me know if you have any questions.
&lt;BR /&gt;
&lt;BR /&gt;Regards
&lt;BR /&gt;Shong</description>
      <pubDate>Fri, 27 Dec 2019 03:29:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-separate-json-array-elements-in-separate-json-outputs/m-p/2220391#M14810</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-12-27T03:29:35Z</dc:date>
    </item>
  </channel>
</rss>

