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!

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...

Splunk APM: New Product Features + Community Office Hours Recap!

Howdy Splunk Community! Over the past few months, we’ve had a lot going on in the world of Splunk Application ...

Index This | Forward, I’m heavy; backward, I’m not. What am I?

April 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...