<?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 extract data from JSONModel data array by index in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-extract-data-from-jsonmodel-data-array-by-index/m-p/12638355#M2014009</link>
    <description>&lt;P&gt;Hi  &lt;SPAN class="mention-scrubbed"&gt;mhcho&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;In my case I normaly use:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;oEvent.getParameter("listItem").getBindingContext().getObject();&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;or in case for multiple selection I use:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;const selectedItems = this.getView().byId("&lt;/EM&gt;&lt;EM&gt;oModel&lt;/EM&gt;&lt;EM&gt;").getSelectedItems();&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;selectedItems[i].getBindingContext("oModel").getProperty("key");&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;I attach a link that adds another option: &lt;A href="https://answers.sap.com/questions/267861/how-to-get-selected-item-binding-context-and-model.html" target="_blank"&gt;link&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I hope it helps.&lt;/P&gt;&lt;P&gt;Best regards!&lt;/P&gt;</description>
    <pubDate>Tue, 28 Jun 2022 22:49:13 GMT</pubDate>
    <dc:creator>sgonzmot</dc:creator>
    <dc:date>2022-06-28T22:49:13Z</dc:date>
    <item>
      <title>How to extract data from JSONModel data array by index</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-extract-data-from-jsonmodel-data-array-by-index/m-p/12638354#M2014008</link>
      <description>&lt;P&gt;&lt;A href="https://answers.sap.com/storage/temp/2064601-data.png" data-attachment="2064601"&gt;data.png&lt;/A&gt;Dear all,&lt;/P&gt;
  &lt;P&gt;We are developing SAPUI5 application. We are getting data from Oracle by using JSON data by ASP.net application.&lt;/P&gt;
  &lt;P&gt;We are able to read the data successfully and the sample program is as follows:&lt;/P&gt;
  &lt;P&gt;var oTab = this.getView().byId("table");&lt;/P&gt;
  &lt;P&gt;var isel = oTab.getSelectedIndices();&lt;/P&gt;
  &lt;P&gt;var oTab2 = this.getView().byId("table2");&lt;/P&gt;
  &lt;P&gt;var text = oTab.getModel().oData[isel].partNo;&lt;/P&gt;
  &lt;P&gt;oMod = new sap.ui.model.json.JSONModel("http://localhost:5242/Part?$filter=PartNo eq '" + text + "' &amp;amp; orderby=revision desc");&lt;/P&gt;
  &lt;P&gt;this.getView().setModel(oMod, "Part");&lt;/P&gt;
  &lt;P&gt;oTab2.setModel(oMod);&lt;/P&gt;
  &lt;P&gt;oTab2.bindRows("/");&lt;/P&gt;
  &lt;P&gt;I am attaching two screen capture files and one of them is the data came out from ASP.net and the other is console log of JSONModel using data from ASP.net.&lt;/P&gt;
  &lt;P&gt;What I would like to know is how I can extract data from JSONModel.&lt;/P&gt;
  &lt;P&gt;I have tried to use were &lt;/P&gt;
  &lt;P&gt;this.getView().getModel("Part").getProperty("/"), some other function calls.&lt;/P&gt;
  &lt;P&gt;But It was not successful to extract the data from oMod.&lt;/P&gt;
  &lt;P&gt;Can someone help me to extract the data in JSONModel ?&lt;/P&gt;
  &lt;P&gt;&lt;A href="https://answers.sap.com/storage/temp/2064600-jsonmodel.png" data-attachment="2064600"&gt;jsonmodel.png&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jun 2022 04:54:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-extract-data-from-jsonmodel-data-array-by-index/m-p/12638354#M2014008</guid>
      <dc:creator>mhcho</dc:creator>
      <dc:date>2022-06-27T04:54:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract data from JSONModel data array by index</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-extract-data-from-jsonmodel-data-array-by-index/m-p/12638355#M2014009</link>
      <description>&lt;P&gt;Hi  &lt;SPAN class="mention-scrubbed"&gt;mhcho&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;In my case I normaly use:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;oEvent.getParameter("listItem").getBindingContext().getObject();&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;or in case for multiple selection I use:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;const selectedItems = this.getView().byId("&lt;/EM&gt;&lt;EM&gt;oModel&lt;/EM&gt;&lt;EM&gt;").getSelectedItems();&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;selectedItems[i].getBindingContext("oModel").getProperty("key");&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;I attach a link that adds another option: &lt;A href="https://answers.sap.com/questions/267861/how-to-get-selected-item-binding-context-and-model.html" target="_blank"&gt;link&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I hope it helps.&lt;/P&gt;&lt;P&gt;Best regards!&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2022 22:49:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-extract-data-from-jsonmodel-data-array-by-index/m-p/12638355#M2014009</guid>
      <dc:creator>sgonzmot</dc:creator>
      <dc:date>2022-06-28T22:49:13Z</dc:date>
    </item>
  </channel>
</rss>

