I am attempting to use the JavaScript API to configure a default filter selection state. Here is the code I am using for this example:
$(function() {
var placeholderDiv = document.getElementById("tableauViz");
var url = "https://sometableausite/t/Tableau_Dev/views/MyPath/HomeDashboard?:embed=y&:showShareOptions=true&:display_count=no&:showVizHome=no";
var options = {
hideTabs: false,
width: "100%",
height: "1552px",
onFirstInteractive: function() {
var worksheet;
var filtersVal='';
var onSuccess = function (filters) {
console.log("This worksheet has " + filters.length + " filter(s) associated with it.");
$.each(filters, function (filter, i) {
// use .value property of each DataValue object
filtersVal += i.getFieldName() + ", ";
console.log(filtersVal);
});
};
var onError = function (err) {
console.log(err);
};
viz.getWorkbook().activateSheetAsync("Performance").then(function(sheet) {
worksheet = sheet;
worksheet.getWorksheets()[0].getFiltersAsync().then(onSuccess, onError);
});
}
};
var viz = new tableau.Viz(placeholderDiv, url, options);
});
This is just trying to get the available filter options at this point but I am getting a 500 server error and getting kicked into the onError call when calling worksheet.getWorksheets()[0].getFiltersAsync().
Here is the error returned:
gives a 500 server error.
TableauException: INTERNAL ERROR
2016-06-22 19:27:53.350
(V2rmuQrmAA0AAEGQy60AAALP,0,2)
What can I do to get the list of filters available?
Aucun commentaire:
Enregistrer un commentaire