<?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: Set value of property from RemoteThing in ThingWorx Developers</title>
    <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Set-value-of-property-from-RemoteThing/m-p/959689#M67077</link>
    <description>&lt;P&gt;The issue is most probably that SetPropertyValues (notice the plural for setting &lt;EM&gt;multiple&lt;/EM&gt; values) expects you to provide an infotable for all the properties and values you want to set. The code you provided just passes over a simple object.&lt;/P&gt;
&lt;P&gt;The valid code would be something along this:&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;let t = Resources["InfoTableFunctions"].CreateInfoTable();
t.AddField({name: "IndustrialThing", baseType: 'THINGNAME'});
t.AddRow({IndustrialThing:"ANOTHERTHING"});
Things["MYTHING"].SetPropertyValues({values: t});&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Maybe Velkumar's suggestion is the better way to go.&lt;/P&gt;</description>
    <pubDate>Thu, 04 Jul 2024 06:23:04 GMT</pubDate>
    <dc:creator>Rocko</dc:creator>
    <dc:date>2024-07-04T06:23:04Z</dc:date>
    <item>
      <title>Set value of property from RemoteThing</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Set-value-of-property-from-RemoteThing/m-p/959583#M67071</link>
      <description>&lt;P&gt;I have a Thing with some properties from RemoteThings.&lt;/P&gt;&lt;P&gt;The type of the 'IndustrialThing' property is Thing.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LR_11305480_0-1720011726447.png" style="width: 782px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/107281i9B6E8C21C3EDE818/image-dimensions/782x26?v=v2" width="782" height="26" role="button" title="LR_11305480_0-1720011726447.png" alt="LR_11305480_0-1720011726447.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Manually, I can set the value to 'ANOTHERTHING' if I want to, but I want to set it through a service using code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried the code below, it gives no errors, but it doesn't work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;var params = {
    propertyName: 'IndustrialThing',
    propertyValue: 'ANOTHERTHING'
};
Things['MYTHING'].SetPropertyValues(params);&lt;/LI-CODE&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;</description>
      <pubDate>Wed, 03 Jul 2024 13:08:09 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Set-value-of-property-from-RemoteThing/m-p/959583#M67071</guid>
      <dc:creator>LR_11305480</dc:creator>
      <dc:date>2024-07-03T13:08:09Z</dc:date>
    </item>
    <item>
      <title>Re: Set value of property from RemoteThing</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Set-value-of-property-from-RemoteThing/m-p/959666#M67074</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/845020"&gt;@LR_11305480&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try below code :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;Things["THINGNAME"].PROPERTYNAME = "PROPERTYVALUE";&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/VR&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jul 2024 04:55:49 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Set-value-of-property-from-RemoteThing/m-p/959666#M67074</guid>
      <dc:creator>Velkumar</dc:creator>
      <dc:date>2024-07-04T04:55:49Z</dc:date>
    </item>
    <item>
      <title>Re: Set value of property from RemoteThing</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Set-value-of-property-from-RemoteThing/m-p/959689#M67077</link>
      <description>&lt;P&gt;The issue is most probably that SetPropertyValues (notice the plural for setting &lt;EM&gt;multiple&lt;/EM&gt; values) expects you to provide an infotable for all the properties and values you want to set. The code you provided just passes over a simple object.&lt;/P&gt;
&lt;P&gt;The valid code would be something along this:&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;let t = Resources["InfoTableFunctions"].CreateInfoTable();
t.AddField({name: "IndustrialThing", baseType: 'THINGNAME'});
t.AddRow({IndustrialThing:"ANOTHERTHING"});
Things["MYTHING"].SetPropertyValues({values: t});&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Maybe Velkumar's suggestion is the better way to go.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jul 2024 06:23:04 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Set-value-of-property-from-RemoteThing/m-p/959689#M67077</guid>
      <dc:creator>Rocko</dc:creator>
      <dc:date>2024-07-04T06:23:04Z</dc:date>
    </item>
    <item>
      <title>Re: Set value of property from RemoteThing</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Set-value-of-property-from-RemoteThing/m-p/959732#M67083</link>
      <description>&lt;P&gt;Thank you very much, Rocko!&lt;/P&gt;&lt;P&gt;That was exactly the problem with my code.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jul 2024 11:42:17 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Set-value-of-property-from-RemoteThing/m-p/959732#M67083</guid>
      <dc:creator>LR_11305480</dc:creator>
      <dc:date>2024-07-04T11:42:17Z</dc:date>
    </item>
  </channel>
</rss>

