I am using the Tableau Server REST API via the python server client library (https://github.com/tableau/server-client-python) to automatically download pdf versions of several tableau workbook views.
For each pdf export I am filtering the Tableau view according to set parameter values. Currently, all possible parameter values are specified manually but I would like to instead find all possible options and loop over those (generating one pdf per filter option). Is that possible?
A small example code where a tableau view is filtered on the parameter country and possible values "Sweden" and "Norway":
import tableauserverclient as TSC
Parameters = [{"Parameter Name" : "Country", "ParameterValue" : "Sweden"},
{"Parameter Name" : "Country", "ParameterValue" : "Norway"}]
for params in Parameters:
image_req_options = TSC.PDFRequestOptions()
image_req_options.vf(params["ParameterName"], params["ParameterValue"]
server.views.populate_pdf(view, image_req_options)
with open('output_pdf_{}.pdf'.format(params["ParameterValue"]), 'wb') as f:
f.write(view.pdf)
Instead of defining the Parameters list of dictionaries I would like to find all possible ParameterValues for the Parameter Country.