cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

How to check whether any child node has parent or not in a network using script in TWX 9?

ranjank
14-Alexandrite

How to check whether any child node has parent or not in a network using script in TWX 9?

Hi Team,

 

Suppose I want to write a service which take any node of a network as an input and check whether that input node has any parent exist or not (i.e. Boolean Output), then what would be the snippet to be used?

 

Please help me the logic or provide some in-built PTC api service.

 

Thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
mnarang
17-Peridot
(To:ranjank)

Did you try using "GetParentName" snippet of Network entity ? If it give you a name you can return true if it does not you can return false.

 

// result: STRING
var result = Networks["MyNetwork"].GetParentName({
name: "Asset_1-2" /* STRING */
});

View solution in original post

1 REPLY 1
mnarang
17-Peridot
(To:ranjank)

Did you try using "GetParentName" snippet of Network entity ? If it give you a name you can return true if it does not you can return false.

 

// result: STRING
var result = Networks["MyNetwork"].GetParentName({
name: "Asset_1-2" /* STRING */
});

Top Tags