<?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: About newEntry object and addRow to the result object to infotable when and where we need to add in ThingWorx Developers</title>
    <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/About-newEntry-object-and-addRow-to-the-result-object-to/m-p/781552#M57076</link>
    <description>&lt;P&gt;Can you try creating the object out of these blocks, even if you have these blocks in a loop, then try to put the new object out of the loop. Ideally, if you create the object only once and add the rows to the object as per the condition it should work. It works something like this:&lt;/P&gt;&lt;P&gt;var obj = new Object();&lt;BR /&gt;for(var i=0;i&amp;lt;2;i++)&lt;BR /&gt;{&lt;BR /&gt;obj.A="Hello";&lt;BR /&gt;obj.B="There";&lt;BR /&gt;result1.AddRow(obj);&lt;BR /&gt;obj.A="T";&lt;BR /&gt;obj.B="R";&lt;BR /&gt;result1.AddRow(obj);&lt;BR /&gt;}&lt;BR /&gt;Where A and B are my fields of DataShape.&lt;BR /&gt;Thanks,&lt;/P&gt;&lt;P&gt;Mukul&lt;/P&gt;</description>
    <pubDate>Tue, 01 Mar 2022 13:53:35 GMT</pubDate>
    <dc:creator>Mukul</dc:creator>
    <dc:date>2022-03-01T13:53:35Z</dc:date>
    <item>
      <title>About newEntry object and addRow to the result object to infotable when and where we need to add thi</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/About-newEntry-object-and-addRow-to-the-result-object-to/m-p/780987#M57038</link>
      <description>&lt;P&gt;Hello ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to pull data from json based on various inputs. i have placed some conditions and write 3 if statements and in that if statements i have created var newEntry- new Object() and also write result.addRow(newEntry) in all 3 if statements. in logger its working fine but unable to display infotable and its still executing and goes into infinite loop.&lt;/P&gt;&lt;P&gt;so I want to know when and where need to create newEntry object and where i need to write result.addRow(newEntry). please help me out on this.&lt;/P&gt;&lt;P&gt;eg:&lt;/P&gt;&lt;P&gt;else if(leng==0){&lt;BR /&gt;var newEntry1=new Object();&lt;BR /&gt;newEntry1.Name="";&lt;BR /&gt;newEntry1.Number="";&lt;BR /&gt;newEntry1.partId="";&lt;BR /&gt;result.AddRow(newEntry1);&lt;BR /&gt;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;else if(leng==1){&lt;BR /&gt;var newEntry2=new Object();&lt;BR /&gt;newEntry2.Name=dt.values[j].Name;&lt;BR /&gt;newEntry2.Number=dt.values[j].Number;&lt;BR /&gt;newEntry2.partId=text;&lt;/P&gt;&lt;P&gt;result.AddRow(newEntry2);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;ksm&lt;/P&gt;</description>
      <pubDate>Sat, 26 Feb 2022 17:56:30 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/About-newEntry-object-and-addRow-to-the-result-object-to/m-p/780987#M57038</guid>
      <dc:creator>KSM</dc:creator>
      <dc:date>2022-02-26T17:56:30Z</dc:date>
    </item>
    <item>
      <title>Re: About newEntry object and addRow to the result object to infotable when and where we need to add</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/About-newEntry-object-and-addRow-to-the-result-object-to/m-p/781552#M57076</link>
      <description>&lt;P&gt;Can you try creating the object out of these blocks, even if you have these blocks in a loop, then try to put the new object out of the loop. Ideally, if you create the object only once and add the rows to the object as per the condition it should work. It works something like this:&lt;/P&gt;&lt;P&gt;var obj = new Object();&lt;BR /&gt;for(var i=0;i&amp;lt;2;i++)&lt;BR /&gt;{&lt;BR /&gt;obj.A="Hello";&lt;BR /&gt;obj.B="There";&lt;BR /&gt;result1.AddRow(obj);&lt;BR /&gt;obj.A="T";&lt;BR /&gt;obj.B="R";&lt;BR /&gt;result1.AddRow(obj);&lt;BR /&gt;}&lt;BR /&gt;Where A and B are my fields of DataShape.&lt;BR /&gt;Thanks,&lt;/P&gt;&lt;P&gt;Mukul&lt;/P&gt;</description>
      <pubDate>Tue, 01 Mar 2022 13:53:35 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/About-newEntry-object-and-addRow-to-the-result-object-to/m-p/781552#M57076</guid>
      <dc:creator>Mukul</dc:creator>
      <dc:date>2022-03-01T13:53:35Z</dc:date>
    </item>
    <item>
      <title>Re: About newEntry object and addRow to the result object to infotable when and where we need to add</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/About-newEntry-object-and-addRow-to-the-result-object-to/m-p/781747#M57089</link>
      <description>&lt;P&gt;Hi Mukul,&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;what ever you have suggested in the above code, there is a chance of overwriting the data which is already in result object. I means when&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;var obj = new Object();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;for(var i=0;i&amp;lt;2;i++)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;obj.A="Hello";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;obj.B="There";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;result1.AddRow(obj);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;obj.A="T";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;obj.B="R";&lt;/SPAN&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT color="#3366FF"&gt;result1.AddRow(obj);&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The Highlighted&amp;nbsp;result1 will be replace the data with new one.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Mahaboob basha&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Mar 2022 04:20:24 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/About-newEntry-object-and-addRow-to-the-result-object-to/m-p/781747#M57089</guid>
      <dc:creator>KSM</dc:creator>
      <dc:date>2022-03-02T04:20:24Z</dc:date>
    </item>
    <item>
      <title>Re: About newEntry object and addRow to the result object to infotable when and where we need to add</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/About-newEntry-object-and-addRow-to-the-result-object-to/m-p/781760#M57093</link>
      <description>&lt;P&gt;Nothing will be replaced, you have already added the previous row and then you are adding a new row. Here is the output of this code : If you see the output it is adding 4 rows(which is expected).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Mukul_0-1646202112194.png" style="width: 400px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/53734iC67412479EAFE57B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Mukul_0-1646202112194.png" alt="Mukul_0-1646202112194.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Mar 2022 06:22:41 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/About-newEntry-object-and-addRow-to-the-result-object-to/m-p/781760#M57093</guid>
      <dc:creator>Mukul</dc:creator>
      <dc:date>2022-03-02T06:22:41Z</dc:date>
    </item>
    <item>
      <title>Re: About newEntry object and addRow to the result object to infotable when and where we need to add</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/About-newEntry-object-and-addRow-to-the-result-object-to/m-p/781761#M57094</link>
      <description>&lt;P&gt;Thanks Mukul,&lt;/P&gt;&lt;P&gt;Its working fine now.&lt;/P&gt;&lt;P&gt;You can mark as a solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Mar 2022 06:28:45 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/About-newEntry-object-and-addRow-to-the-result-object-to/m-p/781761#M57094</guid>
      <dc:creator>KSM</dc:creator>
      <dc:date>2022-03-02T06:28:45Z</dc:date>
    </item>
  </channel>
</rss>

