Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

Flow Designer Action- Required Runtime - Vanilla (Core JavaScript)

q1ecbp6
Tera Contributor

Hi Team,

 

I am trying to search one of the string in one of the http page. I am passing the string as input and where I am saving the output as found if that string is available or not.

========================================================================================

(function execute(inputs, outputs) {
  var url = 'http://XXXXX/networkdevices.html'; // Define the URL to be accessed
  var fqdn = inputs.fqdn; // Get the FQDN from the inputs parameter

  // Perform HTTP request to the specified URL
  var response = new sn_ws.RESTMessageV2();
  response.setHttpMethod('get');
  response.setEndpoint(url);
  var responseBody = response.execute().getBody();

  // Search for the specified FQDN in the response
  if (responseBody.indexOf(fqdn) !== -1) {
    outputs['found'] = true; // Set the 'found' output variable to true
  } else {
    outputs['found'] = false; // Set the 'found' output variable to false
  }
})(inputs, outputs);
 
==================================================================
 
After running the action I am getting following error-
 
Request not sent to uri= http://XXXXX/networkdevices.html : java.net.UnknownHostException: XXXXX: XXXXX
Where XXXXX is server name.
 
Wondering from where that server should be accessible. That server is pingable from the mid server though.
 
Could anyone please tell me what I am missing here?
0 REPLIES 0