Skip to main content
1-Visitor
August 12, 2018
Question

GetChildConnectionsForTemplate no accepting correct parameters?

  • August 12, 2018
  • 1 reply
  • 1185 views

Trying to get a list of children in a Network using the GetChildConnectionsForTemplate function which accepts two parameters, both of which are of STRING type; however I keep getting a Too Many Parameters error when I input two strings.

 

When I try to input a single parameter, it runs with 0 errors but outputs an empty/incorrect table.

1 reply

13-Aquamarine
August 13, 2018

Hi,

 

How do you input the parameters?

 

Consider the following Network.

  • test1
    • DifferentTemplateThing
    • Thing1
    • Thing2

The inputs for the service GetChildConnectionsForTemplate are:

  • name ("test1") - the name of the node for whom to return children
  • thingTemplateName ("GenericThing") - the name of the template implemented by the children

The output of the service should be of type INFOTABLE.

The result contains the 2 children (Thing1 and Thing2) which implement the template GenericThing.

  

Service code

var params = {
name: "test1" /* STRING */,
thingTemplateName: "GenericThing" /* STRING */
};

// result: INFOTABLE dataShape: NetworkConnection
var result = Networks["anetwork"].GetChildConnectionsForTemplate(params);