<?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: Getting the number of field definitions from an infotable in ThingWorx Developers</title>
    <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Getting-the-number-of-field-definitions-from-an-infotable/m-p/633808#M40235</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/304626"&gt;@Constantine&lt;/a&gt;, thanks for reply. I am actually using an IDE to create a custom widget so your solution might not be applicable. Therefore, I will be using mine as shown in the code below.&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;this.updateProperty = function (updatePropertyInfo) {
    var widgetProperties = this.properties;
    var dataRows = updatePropertyInfo.ActualDataRows;
    var nRows = dataRows.length;
    var rowData = new Array();
    for (var i = 0; i &amp;lt; nRows; i++) {
        rowData.push(dataRows[i]);
    }
}
console.log(Object.keys(rowData[0]).length); //returns 4&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 30 Oct 2019 00:02:00 GMT</pubDate>
    <dc:creator>kahmeng96</dc:creator>
    <dc:date>2019-10-30T00:02:00Z</dc:date>
    <item>
      <title>Getting the number of field definitions from an infotable</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Getting-the-number-of-field-definitions-from-an-infotable/m-p/633664#M40218</link>
      <description>&lt;P&gt;Hi all, I am trying to get the number of field definitions from my infotable as shown.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 478px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/20645i8B75F24B072CBA81/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;In this case, I want the number of field definitions to return 4. I've tried using getFieldCount() but it doesn't seem to work, any help will be greatly appreciated!&lt;/P&gt;</description>
      <pubDate>Tue, 29 Oct 2019 08:15:23 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Getting-the-number-of-field-definitions-from-an-infotable/m-p/633664#M40218</guid>
      <dc:creator>kahmeng96</dc:creator>
      <dc:date>2019-10-29T08:15:23Z</dc:date>
    </item>
    <item>
      <title>Re: Getting the number of field definitions from an infotable</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Getting-the-number-of-field-definitions-from-an-infotable/m-p/633740#M40227</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There you are:&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;myProperty.dataShape.fields.size()&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/ Constantine&lt;/P&gt;</description>
      <pubDate>Tue, 29 Oct 2019 13:43:07 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Getting-the-number-of-field-definitions-from-an-infotable/m-p/633740#M40227</guid>
      <dc:creator>Constantine</dc:creator>
      <dc:date>2019-10-29T13:43:07Z</dc:date>
    </item>
    <item>
      <title>Re: Getting the number of field definitions from an infotable</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Getting-the-number-of-field-definitions-from-an-infotable/m-p/633808#M40235</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/304626"&gt;@Constantine&lt;/a&gt;, thanks for reply. I am actually using an IDE to create a custom widget so your solution might not be applicable. Therefore, I will be using mine as shown in the code below.&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;this.updateProperty = function (updatePropertyInfo) {
    var widgetProperties = this.properties;
    var dataRows = updatePropertyInfo.ActualDataRows;
    var nRows = dataRows.length;
    var rowData = new Array();
    for (var i = 0; i &amp;lt; nRows; i++) {
        rowData.push(dataRows[i]);
    }
}
console.log(Object.keys(rowData[0]).length); //returns 4&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Oct 2019 00:02:00 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Getting-the-number-of-field-definitions-from-an-infotable/m-p/633808#M40235</guid>
      <dc:creator>kahmeng96</dc:creator>
      <dc:date>2019-10-30T00:02:00Z</dc:date>
    </item>
  </channel>
</rss>

