<?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: SAP CPI XML to JSON conversion: Force output as an Array in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/sap-cpi-xml-to-json-conversion-force-output-as-an-array/qaa-p/11952931#M4493028</link>
    <description>&lt;P&gt;Hi Both,&lt;/P&gt;&lt;P&gt;you are right. This is just a display bug.&lt;/P&gt;&lt;P&gt;Thanks a lot for your prompt feedback!!&lt;/P&gt;</description>
    <pubDate>Mon, 24 Jun 2019 08:48:37 GMT</pubDate>
    <dc:creator>filipe_rieger</dc:creator>
    <dc:date>2019-06-24T08:48:37Z</dc:date>
    <item>
      <title>SAP CPI XML to JSON conversion: Force output as an Array</title>
      <link>https://community.sap.com/t5/technology-q-a/sap-cpi-xml-to-json-conversion-force-output-as-an-array/qaq-p/11952928</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
  &lt;P&gt;I am passing following XML to the XML to Json converter:&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;&amp;lt;ns1:AddressCurationResponse xmlns:ns1="urn:sap-com:document:sap:rfc:functions"&amp;gt;
	&amp;lt;CurationInformation&amp;gt;
		&amp;lt;item&amp;gt;
			&amp;lt;Changes&amp;gt;
				&amp;lt;item&amp;gt;
					&amp;lt;ACTION&amp;gt;xyz&amp;lt;/ACTION&amp;gt;
					&amp;lt;FIELD&amp;gt;xyz&amp;lt;/FIELD&amp;gt;
					&amp;lt;MESSAGE&amp;gt;xyz&amp;lt;/MESSAGE&amp;gt;
				&amp;lt;/item&amp;gt;
				&amp;lt;item&amp;gt;
					&amp;lt;ACTION&amp;gt;xyz&amp;lt;/ACTION&amp;gt;
					&amp;lt;FIELD&amp;gt;xyz&amp;lt;/FIELD&amp;gt;
					&amp;lt;MESSAGE&amp;gt;xyz&amp;lt;/MESSAGE&amp;gt;
				&amp;lt;/item&amp;gt;
			&amp;lt;/Changes&amp;gt;
			&amp;lt;PostalAddress&amp;gt;
				&amp;lt;CityName&amp;gt;xyz&amp;lt;/CityName&amp;gt;
				&amp;lt;DistrictName&amp;gt;xyz&amp;lt;/DistrictName&amp;gt;
			&amp;lt;/PostalAddress&amp;gt;
			&amp;lt;Rating&amp;gt;
				&amp;lt;SCORE&amp;gt;1&amp;lt;/SCORE&amp;gt;
				&amp;lt;ACCURACYINDICATOR&amp;gt;1&amp;lt;/ACCURACYINDICATOR&amp;gt;
				&amp;lt;CURATIONLEVEL&amp;gt;1&amp;lt;/CURATIONLEVEL&amp;gt;
			&amp;lt;/Rating&amp;gt;
		&amp;lt;/item&amp;gt;
	&amp;lt;/CurationInformation&amp;gt;
&amp;lt;/ns1:AddressCurationResponse&amp;gt;


&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;PRE&gt;&lt;CODE&gt;Now I want the converter to force output the element ns1:AddressCurationResponse/CurationInformation/item as a json array with [] instead of {}.In the converter there is the option to use json streaming:&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1698490-array.png" /&gt;&lt;/P&gt;
  &lt;P&gt;But upon saving, its telling me that the table should not be empty:&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1698491-empty.png" /&gt;&lt;/P&gt;
  &lt;P&gt;What am I missing?&lt;/P&gt;
  &lt;P&gt;The same question was also asked here, but the solution was not shown unfortunately:&lt;/P&gt;
  &lt;P&gt;&lt;A href="https://answers.sap.com/questions/12689222/get-xml-element-in-json-array-using-xml-o-json-con.html" target="test_blank"&gt;https://answers.sap.com/questions/12689222/get-xml-element-in-json-array-using-xml-o-json-con.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2019 08:24:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sap-cpi-xml-to-json-conversion-force-output-as-an-array/qaq-p/11952928</guid>
      <dc:creator>filipe_rieger</dc:creator>
      <dc:date>2019-06-21T08:24:48Z</dc:date>
    </item>
    <item>
      <title>Re: SAP CPI XML to JSON conversion: Force output as an Array</title>
      <link>https://community.sap.com/t5/technology-q-a/sap-cpi-xml-to-json-conversion-force-output-as-an-array/qaa-p/11952929#M4493026</link>
      <description>&lt;P&gt;Hi Filipe&lt;/P&gt;&lt;P&gt;I've encountered it before and I think that is a false error. Try saving, then exit the IFlow ignoring the error. Then when you reopen the IFlow, the error would no longer be there. Try deploying the IFlow then and test it with a message.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Eng Swee&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2019 08:59:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sap-cpi-xml-to-json-conversion-force-output-as-an-array/qaa-p/11952929#M4493026</guid>
      <dc:creator>engswee</dc:creator>
      <dc:date>2019-06-21T08:59:58Z</dc:date>
    </item>
    <item>
      <title>Re: SAP CPI XML to JSON conversion: Force output as an Array</title>
      <link>https://community.sap.com/t5/technology-q-a/sap-cpi-xml-to-json-conversion-force-output-as-an-array/qaa-p/11952930#M4493027</link>
      <description>&lt;P&gt;Hi Filipe,&lt;/P&gt;&lt;P&gt;I tried with the given XML and below is the output from XML-JSON converter.I had the same error of "Table may not contain empty rows" , i still went and deployed the Iflow . Just close the iflow and reopen it  ,the error disappears.&lt;/P&gt;&lt;P&gt;And note as you are explicit mentioning XML to JSON conversion via enabling streaming option , make sure you mention the other paths as well which need to be and array to form a valid JSON in . In you case for the above payload even : / AddressCurationResponse/CurationInformation/item/Changes/item&lt;/P&gt;&lt;P&gt; also needs to be an array.&lt;/P&gt;&lt;P&gt;Converter:&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1699506-xml-to-json.png" /&gt;&lt;/P&gt;&lt;P&gt;OutPut:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;{"AddressCurationResponse":{"CurationInformation":{"item":[{"Changes":{"item":{"ACTION":"xyz","FIELD":"xyz","MESSAGE":"xyz"},"item":{"ACTION":"xyz","FIELD":"xyz","MESSAGE":"xyz"}},"PostalAddress":{"CityName":"xyz","DistrictName":"xyz"},"Rating":{"SCORE":"1","ACCURACYINDICATOR":"1","CURATIONLEVEL":"1"}}]}}}&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 21 Jun 2019 09:34:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sap-cpi-xml-to-json-conversion-force-output-as-an-array/qaa-p/11952930#M4493027</guid>
      <dc:creator>manoj_khavatkopp</dc:creator>
      <dc:date>2019-06-21T09:34:28Z</dc:date>
    </item>
    <item>
      <title>Re: SAP CPI XML to JSON conversion: Force output as an Array</title>
      <link>https://community.sap.com/t5/technology-q-a/sap-cpi-xml-to-json-conversion-force-output-as-an-array/qaa-p/11952931#M4493028</link>
      <description>&lt;P&gt;Hi Both,&lt;/P&gt;&lt;P&gt;you are right. This is just a display bug.&lt;/P&gt;&lt;P&gt;Thanks a lot for your prompt feedback!!&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2019 08:48:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sap-cpi-xml-to-json-conversion-force-output-as-an-array/qaa-p/11952931#M4493028</guid>
      <dc:creator>filipe_rieger</dc:creator>
      <dc:date>2019-06-24T08:48:37Z</dc:date>
    </item>
  </channel>
</rss>

