Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Code works in Node.js but not in Flow Designer - Get Catalog Variables

Cesar Barria
Tera Contributor

The file fw_grid_json.txt contains the output of the following statement in Flow Designer associated with the Description Field of a Change Ticket.

return fd_data._2__get_catalog_variables.eto_firewall_rules_grid_result.toString();

The flow will write the contents to the Description Field of the Change Ticket. 

The file firewall_desc_js.txt contains the actual code we want to use to populate the Description field. However, this results in the following text written to the description field:

Requestor: Some User
Supervisor: Some Manager
Application Details: Test

Firewall Rules:
operation;source;destination;destport;destprotocol;bidirectional;action
;;;;;;
;;;;;;
;;;;;;
;;;;;;

 

The file gridresult_js.txt correctly processes the fw_grid_json.txt file and outputs the correct description: (We've excluded a few fields not needed for the test)
Firewall Rules:
operation;source;destination;destport;destprotocol;bidirectional;action
add;any;any;80,443;tcp;yes;accept
add;10.102.10.0/24;any;80,443;udp;yes;accept
add;10.102.10.0/24;10.102.11.0/24;2048-4096;both;yes;accept
add;any;10.102.16.32;45000;both;no;deny


The eto_firewall_rules_grid_result variable comes from using the following CTV app to create a Grid like this one:

CesarBarria_0-1697576506551.png


The app can be found here: Catalog Table Variable (Kingston/London/Madrid Updates) - Share | ServiceNow Developers


I don't know why it works outside Flow Designer, but won't work when the code is executed by Flow Designer.

Any help is appreciated,

0 REPLIES 0