<?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: how to remove &amp;quot;Unable To Parse JSON Request&amp;quot; error? in ThingWorx Developers</title>
    <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/how-to-remove-quot-Unable-To-Parse-JSON-Request-quot-error/m-p/716316#M50837</link>
    <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/205559"&gt;@nmilleson&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;my validation service is running correct but when m trying to run through mashup it shows an error &lt;STRONG&gt;"&lt;SPAN style="font-family: inherit;"&gt;Execution error in service script [AddBandValidation] :: Unable To Convert From java.lang.String to INTEGER&lt;/SPAN&gt;&lt;SPAN style="font-family: inherit;"&gt;"&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;below is my code and mashup error snapshot please check for your better understanding:-&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;&lt;STRONG&gt;// result: INFOTABLE dataShape: "checkBandDeviceDataDS"&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp;let result = me.checkBandDeviceId({&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;device_id: device_ID /* INTEGER */&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;});&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;if(device_ID == null){&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;result = 'Please enter device id';&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;else if(result.device_id == device_ID){&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;result = 'This device id is already exist';&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;else {&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;result = '';&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;}&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;the above code is running properly but when m clicking on &lt;STRONG&gt;add new band&lt;/STRONG&gt; button in mashup then it is giving me an error&amp;nbsp;&lt;STRONG&gt;"Execution error in service script [AddBandValidation] :: Unable To Convert From java.lang.String to INTEGER"&lt;/STRONG&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="122_0-1614689040260.png" style="width: 400px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/38313iD567ED727FCA7495/image-size/medium?v=v2&amp;amp;px=400" role="button" title="122_0-1614689040260.png" alt="122_0-1614689040260.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 02 Mar 2021 12:44:36 GMT</pubDate>
    <dc:creator>Ru</dc:creator>
    <dc:date>2021-03-02T12:44:36Z</dc:date>
    <item>
      <title>how to remove "Unable To Parse JSON Request" error?</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/how-to-remove-quot-Unable-To-Parse-JSON-Request-quot-error/m-p/714781#M50695</link>
      <description>&lt;P&gt;hello,&lt;/P&gt;
&lt;P&gt;getting an error "Unable To Parse JSON Request" while adding device id through mashup.&lt;/P&gt;
&lt;P&gt;i have one code which gives me existing device id in database and i my another code is validation service created for the mashup where i wanted to compare device id present in database with the validation service input device id.&lt;/P&gt;
&lt;P&gt;Now when i click on add band button it gives me an error "Unable To Parse JSON Request" i dont know why i am getting this error. below is my validation service code:-&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;// result: INFOTABLE dataShape: "checkBandDeviceDataDS"&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;let result1 = me.checkBandDeviceId({&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;device_id: device_id /* INTEGER */&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;});&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;if(device_id == "" || device_id == null){&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;result = 'Please enter device id';&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;else if(result1.device_id == device_id){&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;result = 'This device id is already exist';&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;else {&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;result = '';&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;above code is running perfectly when i run the personal code but it's not running through mashup, please suggest some solution on this, below is snapshot for your better understanding&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="122_0-1614069046648.png" style="width: 400px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/37940iAAFF9C0A78C54024/image-size/medium?v=v2&amp;amp;px=400" role="button" title="122_0-1614069046648.png" alt="122_0-1614069046648.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Feb 2021 08:42:28 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/how-to-remove-quot-Unable-To-Parse-JSON-Request-quot-error/m-p/714781#M50695</guid>
      <dc:creator>Ru</dc:creator>
      <dc:date>2021-02-23T08:42:28Z</dc:date>
    </item>
    <item>
      <title>Re: how to remove "Unable To Parse JSON Request" error?</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/how-to-remove-quot-Unable-To-Parse-JSON-Request-quot-error/m-p/714857#M50701</link>
      <description>&lt;P&gt;I run into this issue occasionally when I try and pass Integers into a service in a mashup.&amp;nbsp; My workaround has been to change the service input type to a String and then do a parseInt() in the service.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Feb 2021 14:34:37 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/how-to-remove-quot-Unable-To-Parse-JSON-Request-quot-error/m-p/714857#M50701</guid>
      <dc:creator>nmilleson</dc:creator>
      <dc:date>2021-02-23T14:34:37Z</dc:date>
    </item>
    <item>
      <title>Re: how to remove "Unable To Parse JSON Request" error?</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/how-to-remove-quot-Unable-To-Parse-JSON-Request-quot-error/m-p/715100#M50731</link>
      <description>&lt;P&gt;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/205559"&gt;@nmilleson&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;can you please give me the an example how to use parseInt() function in service ? i have tried to use this function but it's not working...so please help me out&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2021 09:48:24 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/how-to-remove-quot-Unable-To-Parse-JSON-Request-quot-error/m-p/715100#M50731</guid>
      <dc:creator>Ru</dc:creator>
      <dc:date>2021-02-24T09:48:24Z</dc:date>
    </item>
    <item>
      <title>Re: how to remove "Unable To Parse JSON Request" error?</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/how-to-remove-quot-Unable-To-Parse-JSON-Request-quot-error/m-p/715116#M50734</link>
      <description>&lt;P&gt;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/313569"&gt;@Ru&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;parseInt accepts a string and an optional radix... here's an example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;var device_id = parseInt(device_id_string);&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/parseInt" target="_blank"&gt;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/parseInt&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2021 11:38:48 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/how-to-remove-quot-Unable-To-Parse-JSON-Request-quot-error/m-p/715116#M50734</guid>
      <dc:creator>nmilleson</dc:creator>
      <dc:date>2021-02-24T11:38:48Z</dc:date>
    </item>
    <item>
      <title>Re: how to remove "Unable To Parse JSON Request" error?</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/how-to-remove-quot-Unable-To-Parse-JSON-Request-quot-error/m-p/716316#M50837</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/205559"&gt;@nmilleson&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;my validation service is running correct but when m trying to run through mashup it shows an error &lt;STRONG&gt;"&lt;SPAN style="font-family: inherit;"&gt;Execution error in service script [AddBandValidation] :: Unable To Convert From java.lang.String to INTEGER&lt;/SPAN&gt;&lt;SPAN style="font-family: inherit;"&gt;"&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;below is my code and mashup error snapshot please check for your better understanding:-&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;&lt;STRONG&gt;// result: INFOTABLE dataShape: "checkBandDeviceDataDS"&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp;let result = me.checkBandDeviceId({&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;device_id: device_ID /* INTEGER */&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;});&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;if(device_ID == null){&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;result = 'Please enter device id';&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;else if(result.device_id == device_ID){&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;result = 'This device id is already exist';&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;else {&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;result = '';&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;}&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;the above code is running properly but when m clicking on &lt;STRONG&gt;add new band&lt;/STRONG&gt; button in mashup then it is giving me an error&amp;nbsp;&lt;STRONG&gt;"Execution error in service script [AddBandValidation] :: Unable To Convert From java.lang.String to INTEGER"&lt;/STRONG&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="122_0-1614689040260.png" style="width: 400px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/38313iD567ED727FCA7495/image-size/medium?v=v2&amp;amp;px=400" role="button" title="122_0-1614689040260.png" alt="122_0-1614689040260.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Mar 2021 12:44:36 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/how-to-remove-quot-Unable-To-Parse-JSON-Request-quot-error/m-p/716316#M50837</guid>
      <dc:creator>Ru</dc:creator>
      <dc:date>2021-03-02T12:44:36Z</dc:date>
    </item>
    <item>
      <title>Re: how to remove "Unable To Parse JSON Request" error?</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/how-to-remove-quot-Unable-To-Parse-JSON-Request-quot-error/m-p/716528#M50850</link>
      <description>&lt;P&gt;For error &lt;STRONG&gt;&lt;SPAN&gt;Execution error in service script [AddBandValidation] :: Unable To Convert From java.lang.String to INTEGER, &lt;/SPAN&gt;&lt;/STRONG&gt;please check in the scripts code, there might be some place that has&amp;nbsp;String type assign to Integer type. Add some&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;logger.warn("")&lt;/STRONG&gt;&amp;nbsp;to the scripts to narrow down on which line the code is failing and debug the issue.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Mar 2021 06:34:39 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/how-to-remove-quot-Unable-To-Parse-JSON-Request-quot-error/m-p/716528#M50850</guid>
      <dc:creator>SachinSharma</dc:creator>
      <dc:date>2021-03-03T06:34:39Z</dc:date>
    </item>
    <item>
      <title>Re: how to remove "Unable To Parse JSON Request" error?</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/how-to-remove-quot-Unable-To-Parse-JSON-Request-quot-error/m-p/718238#M51019</link>
      <description>&lt;P&gt;Hi &lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/313569"&gt;@Ru&lt;/a&gt;.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;If you feel that your question has been answered, please mark the appropriate response as the Accepted Solution for the benefit of others with the same question.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Regards.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;--Sharon&lt;/P&gt;</description>
      <pubDate>Thu, 11 Mar 2021 18:42:03 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/how-to-remove-quot-Unable-To-Parse-JSON-Request-quot-error/m-p/718238#M51019</guid>
      <dc:creator>slangley</dc:creator>
      <dc:date>2021-03-11T18:42:03Z</dc:date>
    </item>
  </channel>
</rss>

