<?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 Can I &amp;quot;append&amp;quot; two infotables without loop? in ThingWorx Developers</title>
    <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Can-I-quot-append-quot-two-infotables-without-loop/m-p/517251#M13179</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If I have two infotables from the same datashape and I want to make a third one given by the two, is it possible to append them in some "smart way" without doing this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="_jivemacro_uid_14887916579418797 jive_macro_code jive_text_macro" jivemacro_uid="_14887916579418797"&gt;&lt;P&gt;var tableLength = table1.rows.length;&lt;/P&gt;&lt;P&gt;for (var x = 0; x &amp;lt; tableLength; x++){&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var row = table1.rows&lt;X&gt;;&lt;/X&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; table3.AddRow(row);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var tableLength = table2.rows.length;&lt;/P&gt;&lt;P&gt;for (var x = 0; x &amp;lt; tableLength; x++){&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var row = table2.rows&lt;X&gt;;&lt;/X&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; table3.AddRow(row);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;result = table3;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 06 Mar 2017 09:16:06 GMT</pubDate>
    <dc:creator>fmanniti</dc:creator>
    <dc:date>2017-03-06T09:16:06Z</dc:date>
    <item>
      <title>Can I "append" two infotables without loop?</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Can-I-quot-append-quot-two-infotables-without-loop/m-p/517251#M13179</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If I have two infotables from the same datashape and I want to make a third one given by the two, is it possible to append them in some "smart way" without doing this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="_jivemacro_uid_14887916579418797 jive_macro_code jive_text_macro" jivemacro_uid="_14887916579418797"&gt;&lt;P&gt;var tableLength = table1.rows.length;&lt;/P&gt;&lt;P&gt;for (var x = 0; x &amp;lt; tableLength; x++){&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var row = table1.rows&lt;X&gt;;&lt;/X&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; table3.AddRow(row);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var tableLength = table2.rows.length;&lt;/P&gt;&lt;P&gt;for (var x = 0; x &amp;lt; tableLength; x++){&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var row = table2.rows&lt;X&gt;;&lt;/X&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; table3.AddRow(row);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;result = table3;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Mar 2017 09:16:06 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Can-I-quot-append-quot-two-infotables-without-loop/m-p/517251#M13179</guid>
      <dc:creator>fmanniti</dc:creator>
      <dc:date>2017-03-06T09:16:06Z</dc:date>
    </item>
    <item>
      <title>Re: Can I "append" two infotables without loop?</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Can-I-quot-append-quot-two-infotables-without-loop/m-p/517252#M13180</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.thingworx.com/u1/10820"&gt;Fabio Manniti&lt;/A&gt;​,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would do it like following:&lt;/P&gt;&lt;P&gt;1. Get the Row Length of both Infotable.&lt;/P&gt;&lt;P&gt;2. Copy the one with more length in table 3 by just assigning it. Will not loop in.&lt;/P&gt;&lt;P&gt;example: Table1 has 1000 Rows and Table2 10000 rows. So I would just do Table3=Table1.&lt;/P&gt;&lt;P&gt;3. Then loop through the other table and copy each item.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And ThingWorx provide Union option to combine two Infotables into one. I suppose you are looking for this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14887934544973314" jivemacro_uid="_14887934544973314"&gt;&lt;P style="font-size: 13.3333px;"&gt;var params = {&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&amp;nbsp; t1: undefined /* INFOTABLE */,&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&amp;nbsp; t2: undefined /* INFOTABLE */&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;};&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;// result: INFOTABLE&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;var result = Resources["InfoTableFunctions"].Union(params);&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="4562" class="image-1 jive-image" src="https://www.ptcusercommunity.com/legacyfs/online/thingworx/4562_pastedImage_0.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Mar 2017 09:43:20 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Can-I-quot-append-quot-two-infotables-without-loop/m-p/517252#M13180</guid>
      <dc:creator>ankigupta</dc:creator>
      <dc:date>2017-03-06T09:43:20Z</dc:date>
    </item>
  </channel>
</rss>

