<?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: Get XML element in JSON array using XML o JSON converter in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/get-xml-element-in-json-array-using-xml-o-json-converter/qaa-p/11948875#M4491129</link>
    <description>&lt;P&gt;Hi Eng Swee,&lt;/P&gt;&lt;P&gt;The occurrence of accounts is set to 1is to many. Please see below screen shot:&lt;/P&gt;&lt;P&gt;&lt;A href="https://answers.sap.com/storage/temp/1686491-accounts-occurence.png"&gt;accounts-occurence.png&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Settings I am trying to do in standard converter:&lt;A href="https://answers.sap.com/storage/temp/1686492-xmltojsonconverter-setting.png"&gt;xmltojsonconverter-setting.png&lt;/A&gt; but the error is :Table may not contain empty rows.&lt;/P&gt;&lt;P&gt;Is there something wrong that I am trying to achieve.&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Vaishali&lt;/P&gt;</description>
    <pubDate>Wed, 15 May 2019 07:11:43 GMT</pubDate>
    <dc:creator>former_member610899</dc:creator>
    <dc:date>2019-05-15T07:11:43Z</dc:date>
    <item>
      <title>Get XML element in JSON array using XML o JSON converter</title>
      <link>https://community.sap.com/t5/technology-q-a/get-xml-element-in-json-array-using-xml-o-json-converter/qaq-p/11948873</link>
      <description>&lt;P&gt;Hi Experts,&lt;/P&gt;
  &lt;P&gt;I need to get an array of JSON format, but unable to achieve it using XML to JSON converter. Current output:&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;{"accounts":{"resourceId":"No reply","currency":"SEK","product":"Product","name":"Name","clearingNumber":"CLNum","bban":"Bban","_links":{"balances":"","transactions":""}}}

&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;expected output:&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;{"accounts":[{"resourceId":"Test","currency":"000","product":"Medlemskonto","name":"000000","clearingNumber":"0000","bban":"00000","_links":{"balances":{"href":"v1/accounts/000000000/balances"},"transactions":{"href":"v1/accounts/000000/transactions"}}}]}
Can this be achieved using streaming option, on element node but I am getting the array as the table cannot be empty.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 14 May 2019 14:31:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/get-xml-element-in-json-array-using-xml-o-json-converter/qaq-p/11948873</guid>
      <dc:creator>former_member610899</dc:creator>
      <dc:date>2019-05-14T14:31:13Z</dc:date>
    </item>
    <item>
      <title>Re: Get XML element in JSON array using XML o JSON converter</title>
      <link>https://community.sap.com/t5/technology-q-a/get-xml-element-in-json-array-using-xml-o-json-converter/qaa-p/11948874#M4491128</link>
      <description>&lt;P&gt;Hi Vaishali&lt;/P&gt;&lt;P&gt;If your XML payload has only 1 occurrence of &lt;STRONG&gt;accounts&lt;/STRONG&gt;, then the standard XML-to-JSON converter will not automatically generate a JSON array for it. It only does so when the occurrence on the XML is more than 1.&lt;/P&gt;&lt;P&gt;If you need to "force" the &lt;STRONG&gt;accounts&lt;/STRONG&gt; field to be a JSON array even when there is only 1 element inside it, then you need to use a custom XML-to-JSON conversion. You can try out using XML2JSONConverter in &lt;A href="https://blogs.sap.com/2018/09/04/formatconversionbean-arrives-in-cpi/" target="_blank"&gt;FormatConversionBean for CPI&lt;/A&gt;. Parameter &lt;EM&gt;&lt;STRONG&gt;arrayFieldList&lt;/STRONG&gt;&lt;/EM&gt; as detailed in &lt;A href="https://blogs.sap.com/2015/03/18/jsontransformbean-part-2-converting-xml-to-json-content/" target="_blank"&gt;this blog post&lt;/A&gt; provides you the option to "force" the field to be generated as a JSON array. &lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Eng Swee &lt;/P&gt;</description>
      <pubDate>Wed, 15 May 2019 01:50:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/get-xml-element-in-json-array-using-xml-o-json-converter/qaa-p/11948874#M4491128</guid>
      <dc:creator>engswee</dc:creator>
      <dc:date>2019-05-15T01:50:43Z</dc:date>
    </item>
    <item>
      <title>Re: Get XML element in JSON array using XML o JSON converter</title>
      <link>https://community.sap.com/t5/technology-q-a/get-xml-element-in-json-array-using-xml-o-json-converter/qaa-p/11948875#M4491129</link>
      <description>&lt;P&gt;Hi Eng Swee,&lt;/P&gt;&lt;P&gt;The occurrence of accounts is set to 1is to many. Please see below screen shot:&lt;/P&gt;&lt;P&gt;&lt;A href="https://answers.sap.com/storage/temp/1686491-accounts-occurence.png"&gt;accounts-occurence.png&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Settings I am trying to do in standard converter:&lt;A href="https://answers.sap.com/storage/temp/1686492-xmltojsonconverter-setting.png"&gt;xmltojsonconverter-setting.png&lt;/A&gt; but the error is :Table may not contain empty rows.&lt;/P&gt;&lt;P&gt;Is there something wrong that I am trying to achieve.&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Vaishali&lt;/P&gt;</description>
      <pubDate>Wed, 15 May 2019 07:11:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/get-xml-element-in-json-array-using-xml-o-json-converter/qaa-p/11948875#M4491129</guid>
      <dc:creator>former_member610899</dc:creator>
      <dc:date>2019-05-15T07:11:43Z</dc:date>
    </item>
    <item>
      <title>Re: Get XML element in JSON array using XML o JSON converter</title>
      <link>https://community.sap.com/t5/technology-q-a/get-xml-element-in-json-array-using-xml-o-json-converter/qaa-p/11948876#M4491130</link>
      <description>&lt;P&gt;Hi  &lt;SPAN class="mention-scrubbed"&gt;vaishali.applicon&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;I wasn't aware that the standard converter allows custom array conversion when using the Streaming feature (have never used that).&lt;/P&gt;&lt;P&gt;I tried it out and it seems to work fine. Can you try this few things just to find out if your error could be due to other issues:-&lt;/P&gt;&lt;P&gt;- Uncheck "Suppress JSON Root Element&lt;/P&gt;&lt;P&gt;- Ensure your namespace setup is correct in both the converter, and also the overall IFlow (under Runtime Configuration)&lt;/P&gt;&lt;P&gt;If it still does not work, please provide your XSD schema and the sample source payload.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Eng Swee&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2019 01:57:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/get-xml-element-in-json-array-using-xml-o-json-converter/qaa-p/11948876#M4491130</guid>
      <dc:creator>engswee</dc:creator>
      <dc:date>2019-05-16T01:57:39Z</dc:date>
    </item>
    <item>
      <title>Re: Get XML element in JSON array using XML o JSON converter</title>
      <link>https://community.sap.com/t5/technology-q-a/get-xml-element-in-json-array-using-xml-o-json-converter/qaa-p/11948877#M4491131</link>
      <description>&lt;P&gt;Hi ALl,&lt;/P&gt;&lt;P&gt;I was able to solve the issue. Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2019 12:14:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/get-xml-element-in-json-array-using-xml-o-json-converter/qaa-p/11948877#M4491131</guid>
      <dc:creator>former_member610899</dc:creator>
      <dc:date>2019-05-21T12:14:07Z</dc:date>
    </item>
  </channel>
</rss>

