<?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: use of GetServiceDefinitions for uncategorized services in ThingWorx Developers</title>
    <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/use-of-GetServiceDefinitions-for-uncategorized-services/m-p/927511#M65341</link>
    <description>&lt;P&gt;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/793065"&gt;@DJ_9605282&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sounds like your only option is to go through and categorize all your services as tedious as that may be.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- Nick&lt;/P&gt;</description>
    <pubDate>Thu, 01 Feb 2024 13:29:21 GMT</pubDate>
    <dc:creator>nmilleson</dc:creator>
    <dc:date>2024-02-01T13:29:21Z</dc:date>
    <item>
      <title>use of GetServiceDefinitions for uncategorized services</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/use-of-GetServiceDefinitions-for-uncategorized-services/m-p/927178#M65310</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;with the service:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;result = Things[thingName].GetServiceDefinitions({&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; category: category /* STRING */, ,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; type: undefined /* BASETYPENAME */, ,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; dataShape: undefined /* DATASHAPENAME */&lt;/P&gt;&lt;P&gt;});&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i can get all servicedefinitons of services of a special category.&lt;BR /&gt;But which Sting do I need to use if i want to get all uncategoriezed services?&lt;/P&gt;&lt;P&gt;I've tried&amp;nbsp;*Uncategoriezed*",&amp;nbsp;"'Uncategoriezed*",&amp;nbsp;"**Uncategoriezed**", " ", "",&amp;nbsp;"uncategoriezed",&amp;nbsp;"*uncategoriezed*",&amp;nbsp;"**uncategoriezed**", nothing.&lt;/P&gt;&lt;P&gt;All of them are wrong.&lt;/P&gt;&lt;P&gt;Does anyone have any idea what the right string is?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We use thingworx 9.1.8 and 9.3.7.&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jan 2024 09:18:52 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/use-of-GetServiceDefinitions-for-uncategorized-services/m-p/927178#M65310</guid>
      <dc:creator>DJ_9605282</dc:creator>
      <dc:date>2024-01-31T09:18:52Z</dc:date>
    </item>
    <item>
      <title>Re: use of GetServiceDefinitions for uncategorized services</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/use-of-GetServiceDefinitions-for-uncategorized-services/m-p/927229#M65311</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/793065"&gt;@DJ_9605282&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try to use this:&amp;nbsp;&lt;/P&gt;&lt;P&gt;let result = Things['Thing'].GetServiceDefinitions({&lt;BR /&gt;category: undefined /* STRING */,&lt;BR /&gt;type: undefined /* BASETYPENAME */,&lt;BR /&gt;dataShape: undefined /* DATASHAPENAME */&lt;/P&gt;&lt;P&gt;});&lt;/P&gt;&lt;P&gt;where category is&amp;nbsp;undefined, you should get all services that do not have a category.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jan 2024 12:38:53 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/use-of-GetServiceDefinitions-for-uncategorized-services/m-p/927229#M65311</guid>
      <dc:creator>Janicen</dc:creator>
      <dc:date>2024-01-31T12:38:53Z</dc:date>
    </item>
    <item>
      <title>Re: use of GetServiceDefinitions for uncategorized services</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/use-of-GetServiceDefinitions-for-uncategorized-services/m-p/927267#M65313</link>
      <description>&lt;P&gt;Thanks for your reply,&lt;BR /&gt;Unfortunately, I tried this and as a result I get all the services, with or without a category.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jan 2024 14:08:19 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/use-of-GetServiceDefinitions-for-uncategorized-services/m-p/927267#M65313</guid>
      <dc:creator>DJ_9605282</dc:creator>
      <dc:date>2024-01-31T14:08:19Z</dc:date>
    </item>
    <item>
      <title>Re: use of GetServiceDefinitions for uncategorized services</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/use-of-GetServiceDefinitions-for-uncategorized-services/m-p/927400#M65321</link>
      <description>&lt;P&gt;What if you keep call like this, but then sort result by category == null / undefined? Maybe this is not direct method, but hope it will work?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2024 07:34:10 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/use-of-GetServiceDefinitions-for-uncategorized-services/m-p/927400#M65321</guid>
      <dc:creator>ZbigniewK</dc:creator>
      <dc:date>2024-02-01T07:34:10Z</dc:date>
    </item>
    <item>
      <title>Re: use of GetServiceDefinitions for uncategorized services</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/use-of-GetServiceDefinitions-for-uncategorized-services/m-p/927401#M65322</link>
      <description>&lt;P&gt;You can't filter on that. Either you give it a non-empty string, then it filters for that string (ignoring case), or you give it undefined or an empty string, then the filter is not considered.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2024 07:37:11 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/use-of-GetServiceDefinitions-for-uncategorized-services/m-p/927401#M65322</guid>
      <dc:creator>Rocko</dc:creator>
      <dc:date>2024-02-01T07:37:11Z</dc:date>
    </item>
    <item>
      <title>Re: use of GetServiceDefinitions for uncategorized services</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/use-of-GetServiceDefinitions-for-uncategorized-services/m-p/927405#M65324</link>
      <description>&lt;P&gt;Is that infotable? Then you could create a new infotable, let's called it resultTable.&lt;BR /&gt;Let's rename your result to tempInfotable. Let's make our own sorting procedure.&lt;BR /&gt;Hope it will works, if not - that's my only idea.&amp;nbsp;&lt;BR /&gt;&lt;SPAN&gt;&lt;BR /&gt;let tempInfotable = Things['Thing'].GetServiceDefinitions({&amp;nbsp;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;category: undefined /* STRING */,&lt;BR /&gt;type: undefined /* BASETYPENAME */,&lt;BR /&gt;dataShape: undefined /* DATASHAPENAME */&lt;/P&gt;&lt;P&gt;});&lt;/P&gt;&lt;P&gt;let&amp;nbsp; resultTable= Resources["InfoTableFunctions"].CreateInfoTable();&lt;BR /&gt;let newEntry = new Object ();&lt;BR /&gt;For each (row in tempInfotable.rows) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (row.category == null || row.category == undefined || row.category = "") {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;newObject = row;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;resultInfotable.AddRow(newObject);&amp;nbsp; &amp;nbsp;// I think you could also use directly resultInfotable.AddRow(row);&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/P&gt;&lt;P&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2024 07:52:52 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/use-of-GetServiceDefinitions-for-uncategorized-services/m-p/927405#M65324</guid>
      <dc:creator>ZbigniewK</dc:creator>
      <dc:date>2024-02-01T07:52:52Z</dc:date>
    </item>
    <item>
      <title>Re: use of GetServiceDefinitions for uncategorized services</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/use-of-GetServiceDefinitions-for-uncategorized-services/m-p/927408#M65325</link>
      <description>&lt;P&gt;This will not work as GetServiceDefinitions will not have the category column in its output.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2024 08:00:56 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/use-of-GetServiceDefinitions-for-uncategorized-services/m-p/927408#M65325</guid>
      <dc:creator>Rocko</dc:creator>
      <dc:date>2024-02-01T08:00:56Z</dc:date>
    </item>
    <item>
      <title>Re: use of GetServiceDefinitions for uncategorized services</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/use-of-GetServiceDefinitions-for-uncategorized-services/m-p/927420#M65326</link>
      <description>&lt;P&gt;Yes, this is the problem and there is no way to get the category of a service. For parameters, I can find the categories and have used the two ways that ZbigniewK suggested. Unfortunately, this doesn't work for service.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2024 08:45:09 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/use-of-GetServiceDefinitions-for-uncategorized-services/m-p/927420#M65326</guid>
      <dc:creator>DJ_9605282</dc:creator>
      <dc:date>2024-02-01T08:45:09Z</dc:date>
    </item>
    <item>
      <title>Re: use of GetServiceDefinitions for uncategorized services</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/use-of-GetServiceDefinitions-for-uncategorized-services/m-p/927497#M65338</link>
      <description>&lt;P&gt;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/793065"&gt;@DJ_9605282&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is technically not the "correct" way to do it, but you can set up a database Thing that is connected to your Thingworx database and query the servicedefinitions table.&amp;nbsp; Then you'll be able to query by category (just an empty string).&amp;nbsp; You'll have to join it with a couple of tables (thing_model and entities_servicedefinitions I think) to actually get the services for the Thing you want.&amp;nbsp; Might be easier just to give all your uncategorized services a category though.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- Nick&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2024 13:01:45 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/use-of-GetServiceDefinitions-for-uncategorized-services/m-p/927497#M65338</guid>
      <dc:creator>nmilleson</dc:creator>
      <dc:date>2024-02-01T13:01:45Z</dc:date>
    </item>
    <item>
      <title>Re: use of GetServiceDefinitions for uncategorized services</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/use-of-GetServiceDefinitions-for-uncategorized-services/m-p/927506#M65340</link>
      <description>&lt;P&gt;Yes, this is a possible solution.&lt;/P&gt;&lt;P&gt;Unfortunately, we have a large number of Thingworx servers and each has its own database, partly MS-SQL, partly PostgreSQL. We would have to adjust the connection string and the credentials for each server.&lt;/P&gt;&lt;P&gt;In addition, the tables are not documented, so there is no guarantee that they will not change in a subsequent version. That's too uncertain for me.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2024 13:16:49 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/use-of-GetServiceDefinitions-for-uncategorized-services/m-p/927506#M65340</guid>
      <dc:creator>DJ_9605282</dc:creator>
      <dc:date>2024-02-01T13:16:49Z</dc:date>
    </item>
    <item>
      <title>Re: use of GetServiceDefinitions for uncategorized services</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/use-of-GetServiceDefinitions-for-uncategorized-services/m-p/927511#M65341</link>
      <description>&lt;P&gt;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/793065"&gt;@DJ_9605282&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sounds like your only option is to go through and categorize all your services as tedious as that may be.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- Nick&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2024 13:29:21 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/use-of-GetServiceDefinitions-for-uncategorized-services/m-p/927511#M65341</guid>
      <dc:creator>nmilleson</dc:creator>
      <dc:date>2024-02-01T13:29:21Z</dc:date>
    </item>
    <item>
      <title>Re: use of GetServiceDefinitions for uncategorized services</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/use-of-GetServiceDefinitions-for-uncategorized-services/m-p/927513#M65342</link>
      <description>&lt;P&gt;Assuming you know all the existing categories, here's what you &lt;EM&gt;can&lt;/EM&gt; do: Query all services and subtract all the services returned by querying for all the categories. What's left over are the services without category. Not super-efficient, but it could work - under the assumption.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2024 13:33:38 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/use-of-GetServiceDefinitions-for-uncategorized-services/m-p/927513#M65342</guid>
      <dc:creator>Rocko</dc:creator>
      <dc:date>2024-02-01T13:33:38Z</dc:date>
    </item>
    <item>
      <title>Re: use of GetServiceDefinitions for uncategorized services</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/use-of-GetServiceDefinitions-for-uncategorized-services/m-p/927536#M65345</link>
      <description>&lt;P&gt;Yes, that's exactly how I did it. Unfortunately, I can only filter out the standard categories, because the creative developers come up with countless and always new categories. And since we have hundreds of things and new ones are added every day, I can't possibly find them all.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2024 15:57:30 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/use-of-GetServiceDefinitions-for-uncategorized-services/m-p/927536#M65345</guid>
      <dc:creator>DJ_9605282</dc:creator>
      <dc:date>2024-02-01T15:57:30Z</dc:date>
    </item>
    <item>
      <title>Re: use of GetServiceDefinitions for uncategorized services</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/use-of-GetServiceDefinitions-for-uncategorized-services/m-p/947025#M66530</link>
      <description>&lt;P&gt;Here's a slightly more elegant solution giving you an array of uncategorized services defined on the current thing:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;let entityDef = Resources["EntityServices"].ReadEntityDefinitionAsJSON({name:"&lt;STRONG&gt;YourThingName&lt;/STRONG&gt;", type:"Things"});&lt;BR /&gt;let sDefs=entityDef.effectiveShape.serviceDefinitions;&lt;BR /&gt;let services=Object.keys(sDefs).filter(s=&amp;gt; !sDefs[s].category &amp;amp;&amp;amp; !sDefs[s].sourceName);&lt;/PRE&gt;</description>
      <pubDate>Tue, 30 Apr 2024 09:44:20 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/use-of-GetServiceDefinitions-for-uncategorized-services/m-p/947025#M66530</guid>
      <dc:creator>Rocko</dc:creator>
      <dc:date>2024-04-30T09:44:20Z</dc:date>
    </item>
    <item>
      <title>Re: use of GetServiceDefinitions for uncategorized services</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/use-of-GetServiceDefinitions-for-uncategorized-services/m-p/947053#M66531</link>
      <description>&lt;P&gt;Thank you, thats the very good solution.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Apr 2024 11:18:26 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/use-of-GetServiceDefinitions-for-uncategorized-services/m-p/947053#M66531</guid>
      <dc:creator>DJ_9605282</dc:creator>
      <dc:date>2024-04-30T11:18:26Z</dc:date>
    </item>
  </channel>
</rss>

