Skip to main content
10-Marble
January 9, 2024
Solved

Fetching outgoing dependencies, err: Unable To convert org.mozilla.javascript.UniqueTag to INFOTABLE

  • January 9, 2024
  • 1 reply
  • 1417 views

Trying to fetch the outgoing dependencies of a thing as an infotable  using the GetOutgoingDependencies service in the  PTC.Resource.RelationshipUtilities,  but facing this error :

 Error executing service. Message ::Unable To Convert From org.mozilla.javascript.UniqueTag to INFOTABLE - See Script Error Log for more details.
 
Here: 
var thingName =   "sampleThing"

var mxItems = 10;
var mxDepth = 2;

let params = {
    target: thingName,
    maxItems: mxItems,
    maxDepth: mxDepth
};


    var relData = Resources["PTC.Resource.RelationshipUtilities"].GetOutgoingDependencies(params);



Best answer by Arun_C

Hi @AV_10867476 ,

 

I'm not sure which version of TWX you were using but to find the below code to find outgoing dependencies of a thing and also try to print Ouput in variable of 'result' and make sure that Service Output basetype as 'Infotable'.

 

var thingName = 'YOURTHINGNAME';

let relData = Things[thingName].GetOutgoingDependencies({
	maxItems: 500 /* NUMBER {"defaultValue":500} */
});

let result = relData ;// OUTPUT VARIABLE SHOULD BE IN 'result'

 

Thanks & Regards,

Arun C

1 reply

Arun_C16-PearlAnswer
16-Pearl
January 9, 2024

Hi @AV_10867476 ,

 

I'm not sure which version of TWX you were using but to find the below code to find outgoing dependencies of a thing and also try to print Ouput in variable of 'result' and make sure that Service Output basetype as 'Infotable'.

 

var thingName = 'YOURTHINGNAME';

let relData = Things[thingName].GetOutgoingDependencies({
	maxItems: 500 /* NUMBER {"defaultValue":500} */
});

let result = relData ;// OUTPUT VARIABLE SHOULD BE IN 'result'

 

Thanks & Regards,

Arun C

10-Marble
January 9, 2024

Thanks!