Skip to main content
13-Aquamarine
June 5, 2023
Solved

Why we can't pass the infotable as input in Expression and validator thingworx.

  • June 5, 2023
  • 1 reply
  • 1947 views

Why can't we pass the infotable as input in expression and validator.

 

Best answer by TonyZhang

Hi @Hrishabh.Sharma 

 

I don't have an official answer to why this is the case, probably because for expression and validator, the JS code are executed at client side instead of ThingWorx server side, infotable is a type introduced by ThingWorx rather than in native JS, which means it's not supported by browser or web workers.

Is there a reason why you want to pass infotable to expression or validator instead of using a JS service in ThingWorx?

As a workaround, you can convert infotable to JSON using ToJSON() snippet and pass JSON as input to expression and validator.

TonyZhang_0-1686020463825.png

Hope that helps.

 

1 reply

TonyZhang16-PearlAnswer
16-Pearl
June 6, 2023

Hi @Hrishabh.Sharma 

 

I don't have an official answer to why this is the case, probably because for expression and validator, the JS code are executed at client side instead of ThingWorx server side, infotable is a type introduced by ThingWorx rather than in native JS, which means it's not supported by browser or web workers.

Is there a reason why you want to pass infotable to expression or validator instead of using a JS service in ThingWorx?

As a workaround, you can convert infotable to JSON using ToJSON() snippet and pass JSON as input to expression and validator.

TonyZhang_0-1686020463825.png

Hope that helps.

 

19-Tanzanite
June 6, 2023

The request is really good though, because it would alleviate the need to use Server-side services in many situations when you just need to find a row in an infotable that has been already sent client side, or sort an existing infotable. As an example, the reason we have the old infotableselector widget is because it provides all these capabilities client-side, without the need to overload the server with really small operations like these

 

16-Pearl
June 6, 2023

@VladimirRosu_116627 agreed. I found this has been requested earlier via Jira PSPT-6897 back in 2019.  It says making the infotable selector extension a part of the platform is in a future roadmap but it appears it's still not realized. Not sure what's the current situation now. Maybe customer can raise this idea in https://community.ptc.com/t5/ThingWorx-Ideas/idb-p/thingworxideas