AnsweredAssumed Answered

Dynamic list for User input

Question asked by Johnny Koen Employee on May 31, 2017
Latest reply on Jun 28, 2017 by Johnny Koen

Hi All,


Im trying to create a dynamic list for the user to select from for input variables. If I follow the JS code provided a get the following error. I only get this error when I run the service and not when I test the code in Service builder.


Screen Shot 2017-05-31 at 22.40.23.png


If I hard code the Configuration Manager Rest Server details it works, but it seems like wsc[0].productName, wsc[0].name is not defined when executing the services.


This is a snippet from my code:


function fn(requestPath, queryParamMap, properties) {

  /** This is sample code that calls the Configuration Manager REST API. */

  var storageDeviceID = "800000058990";   

  var remotestorageDeviceID = "800000059012";

  var client = new ConfigurationManager._01_51_01.api.ObjectsApi();


  //Get accessible Web Service Connections by specifying a category name, and specify it. You do not need to specify credentials in a script.

  var wsc = env.getWebServiceConnections("ConfigurationManager");

  //env.setWebServiceConnection(client, wsc[0].productName, wsc[0].name, "/ConfigurationManager");

  env.setWebServiceConnection(client, "ConfigurationManager", "CM-8.5.1", "/ConfigurationManager");