Get Values from UI Page

praneeth24
Kilo Contributor

This is my UI Page.

var json = new Packages.org.json.JSONArray();

    while (jelly.jvar_diag.nextNode()) {

          var diagNode = jelly.jvar_diag.getNode();

          var jsonNode = new Packages.org.json.JSONObject();

          jsonNode.put("name", diagNode.name);

          var vals = new Packages.org.json.JSONArray();

          jsonNode.put("values", vals);

 

      addValueToJSON(vals, "Statistics For", diagNode.stats['instance_name']);

  addValueToJSON(vals, "Build Name", diagNode.stats['glide.build.name']);

  addValueToJSON(vals, "Build Date", diagNode.stats['glide.build.date']);

I need to get the value for Statics for and insert it in an another table.I am able to insert the record but the value is not coming as expected it is undefined.

Anyhelp would be appreciated

10 REPLIES 10

Thank you for your clarification.



If it is an XML field, why are you trying to parse JSON. Am I missing something? Try using XMLDocument to walk your XML file.



XMLDocument Script Object - ServiceNow Wiki