<?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 Matching string to a table of expressions in ThingWorx Developers</title>
    <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Matching-string-to-a-table-of-expressions/m-p/624131#M38603</link>
    <description>&lt;P&gt;I would like to take an input string and check if it matches any expression in a DataTable of expressions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example, if the input string is "SomeError1", and the expressions in the DataTable are:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"SomeError.*"&lt;/P&gt;
&lt;P&gt;"SomeOtherError.*"&lt;/P&gt;
&lt;P&gt;".*Error"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to query if the input string matches any of the expressions in the table. In this case, it would match&amp;nbsp;"SomeError.*".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've tried querying the DataTable entries with LIKE and Matches queries:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;"filters": {&lt;BR /&gt;&amp;nbsp; "type": "Matches",&lt;BR /&gt;&amp;nbsp; &amp;nbsp;"fieldName": "item",&lt;BR /&gt;&amp;nbsp; &amp;nbsp;"expression": "SomeError1"&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"filters": {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; "type": "LIKE",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; "fieldName": "item", &lt;BR /&gt;&amp;nbsp; &amp;nbsp; "value": "SomeError1"&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but it only returns a result if the value/expression field is the expression.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there any way to accomplish this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Tue, 27 Aug 2019 23:25:10 GMT</pubDate>
    <dc:creator>iabshire</dc:creator>
    <dc:date>2019-08-27T23:25:10Z</dc:date>
    <item>
      <title>Matching string to a table of expressions</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Matching-string-to-a-table-of-expressions/m-p/624131#M38603</link>
      <description>&lt;P&gt;I would like to take an input string and check if it matches any expression in a DataTable of expressions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example, if the input string is "SomeError1", and the expressions in the DataTable are:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"SomeError.*"&lt;/P&gt;
&lt;P&gt;"SomeOtherError.*"&lt;/P&gt;
&lt;P&gt;".*Error"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to query if the input string matches any of the expressions in the table. In this case, it would match&amp;nbsp;"SomeError.*".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've tried querying the DataTable entries with LIKE and Matches queries:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;"filters": {&lt;BR /&gt;&amp;nbsp; "type": "Matches",&lt;BR /&gt;&amp;nbsp; &amp;nbsp;"fieldName": "item",&lt;BR /&gt;&amp;nbsp; &amp;nbsp;"expression": "SomeError1"&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"filters": {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; "type": "LIKE",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; "fieldName": "item", &lt;BR /&gt;&amp;nbsp; &amp;nbsp; "value": "SomeError1"&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but it only returns a result if the value/expression field is the expression.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there any way to accomplish this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 27 Aug 2019 23:25:10 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Matching-string-to-a-table-of-expressions/m-p/624131#M38603</guid>
      <dc:creator>iabshire</dc:creator>
      <dc:date>2019-08-27T23:25:10Z</dc:date>
    </item>
    <item>
      <title>Re: Matching string to a table of expressions</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Matching-string-to-a-table-of-expressions/m-p/624248#M38620</link>
      <description>&lt;P&gt;Perhaps you can add a wild card to your search:&amp;nbsp;When using LIKE/NOTLIKE you need to add your own Wild Cards (% or * or ? for a single character wild card). For example to find &lt;SPAN class="ph_002c_ptcProduct"&gt;ThingWorx&lt;/SPAN&gt; use LIKE Th%&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.ptc.com/help/thingworx_hc/thingworx_8_hc/en/#page/ThingWorx%2FHelp%2FComposer%2FThings%2FThingServices%2FQueryParameterforQueryServices.html" target="_blank"&gt;http://support.ptc.com/help/thingworx_hc/thingworx_8_hc/en/#page/ThingWorx%2FHelp%2FComposer%2FThings%2FThingServices%2FQueryParameterforQueryServices.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2019 12:25:20 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Matching-string-to-a-table-of-expressions/m-p/624248#M38620</guid>
      <dc:creator>PaiChung</dc:creator>
      <dc:date>2019-08-28T12:25:20Z</dc:date>
    </item>
    <item>
      <title>Re: Matching string to a table of expressions</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Matching-string-to-a-table-of-expressions/m-p/624314#M38649</link>
      <description>&lt;P&gt;Thanks for the reply, but I'm trying to do the opposite. The search string is the full string and I want to check if it matches any expression (with wildcards) in the table.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2019 16:46:27 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Matching-string-to-a-table-of-expressions/m-p/624314#M38649</guid>
      <dc:creator>iabshire</dc:creator>
      <dc:date>2019-08-28T16:46:27Z</dc:date>
    </item>
    <item>
      <title>Re: Matching string to a table of expressions</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Matching-string-to-a-table-of-expressions/m-p/624340#M38655</link>
      <description>&lt;P&gt;I don't think there is a set query for that, you probably have to loop through your table and just execute a javascript search&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2019 18:27:41 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Matching-string-to-a-table-of-expressions/m-p/624340#M38655</guid>
      <dc:creator>PaiChung</dc:creator>
      <dc:date>2019-08-28T18:27:41Z</dc:date>
    </item>
  </channel>
</rss>

