Dashboards & Visualizations

Update TableView results with external data

bowesmana
SplunkTrust
SplunkTrust

I have a TableView containing results of a search. My problem is that I want to be able to update those results and re-render the table with data from an external source.

I am iterating through those results and making curls requests to an external ServiceNow. What I then need to do is update the status and ticket id of the external call to the original TableView result set.

The code is

    var searchResultsRows = searchResults.data().rows;
    snow.startSearch();
    var snowResult = snow.data('results');
    snowResult.on('data', function() {
      if (snowResult != null) {
        var snowResults = snowResult.data().rows;
        for (var i = 0; i < snowResults.length; i++) {
          searchResultsRows[i][OFFSET_STATUS] = snowResults[i][3];
          searchResultsRows[i][OFFSET_TICKET] = snowResults[i][5];
        }
        detailTable.render();
      }
    });

where detailTable is the original TableView and searchResultsRows is the set of results from that search.

Having debugged the JS render() function in the browser, I can see that there are two problems

  • The searchResultsRows I am updating is not actually the raw data in the table.
  • There appears to be a flag this.isRendered, which appears to be preventing the update, as I have a custom cell renderer that is not being called.

Questions is - anyone know how this is possible, i.e. to force a re-render, and secondly to update the data in the original table.

0 Karma

bowesmana
SplunkTrust
SplunkTrust

I have managed to get the second part of the problem solved, but just including a new eval statement with a token, which I just update with a new token value (that is not shown in the table) and that causes the table to redraw, but I still am not able to update the data itself.

0 Karma
Get Updates on the Splunk Community!

Splunk Mobile: Your Brand-New Home Screen

Meet Your New Mobile Hub  Hello Splunk Community!  Staying connected to your data—no matter where you are—is ...

Introducing Value Insights (Beta): Understand the Business Impact your organization ...

Real progress on your strategic priorities starts with knowing the business outcomes your teams are delivering ...

Enterprise Security (ES) Essentials 8.3 is Now GA — Smarter Detections, Faster ...

As of today, Enterprise Security (ES) Essentials 8.3 is now generally available, helping SOC teams simplify ...