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
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Fuel Your Journey: What’s Waiting for You at the .conf26 Acceleration Station

Navigating the show floor at .conf26 isn't just about keynotes and technical breakout sessions; it's also ...

Join the Final Session of the Data Management & Federation Bootcamp Series

Over the past three sessions of the Data Management & Federation Bootcamp Series, we've explored how to build ...

From Data to Insight: Announcing the Winners of the Splunk Dashboard Contest

Hi Splunkers, First off, thank you to everyone who participated in our very first From Data to Insight: The ...