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!

Unlocking Unified Insights: New Gigamon Federated Search App for Splunk

In today’s data-heavy environment, organizations are caught in a data distribution dilemma. As data volumes ...

GA: New Data Management App in Splunk Platform

Streamlining Data Management: Introducing a unified experience in Splunk Managing data at scale shouldn’t feel ...

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...