'Tableau API for Python, Get Parameter Value -- JS's .getParametersAsync() Equivalent for Python
I want to extract a workbook's currently set parameter values.
I've found reference of the desired request, as someone uses it in JS, but I can't find it anywhere in the REST API documentation, nor the documentation for tableau-api-lib
nor tableauserverclient
. Tableau API: Get parameter value
I can query workbooks just fine using either of the above referenced libraries, but is there a method I'm missing somewhere to get the parameter values?
Ideally I'd like to be able to modify them before a query, but getting what they're currently set at would be a nice start.
Javascript equivalent:
paramObjs = currentViz.getWorkbook().getParametersAsync();
paramObjs.then(function(paramObjs) {
for (var i = 0; i < paramObjs.length; i++) {
try {
var name = paramObjs[i].getName();
var value = paramObjs[i].getCurrentValue();
params[name] = value.value;
} catch (e) { }
}
});
Solution 1:[1]
From what it looks like, this task can not be done using Python.
- The Workbook class here does not have any attributes/methods to get parameters
- Tableau's REST API reference has no method/endpoint for that
- Other API's like the Metadata and Hyper APIs have no connection/correlation with the task
- A list of all Tableau packages/libraries is given here. Going through all Python libraries, there wasn't any method to fetch the parameters.
In JavaScript, they are actually creating visualizations, which allows them to query the visualization itself (currentViz.getWorkbook()
). The same isn't applicable for Python I guess, which explains the missing support/APIs.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 |