Setting Tableau Parameter when it has an allowed values list

What I’m trying to do:

I have a Tableau parameter, that has a list of allowable values, and I’m trying to set that value from the AnvilX app.

What I’ve tried and what’s not working:

I have set the parameter with allowable values like this:

When querying the parameter, and logging things, I get the right list (same as above on the left):

After this when I’m trying to set the value to the given string:

self.dp_chosen_business_unit = self.dashboard.get_parameter("Chosen Business Unit")
# ...
self.dp_chosen_business_unit.change_value(chosen_business_unit)

then the backend / trexjacket throws this issue:

ExternalError: Error: internal-error: Missing output parameter: parameterControl
at app/trexjacket/model/proxies.py:497

and the frontend shows this for me:

I did try setting the same parameter to accept All values (rather than List), and then the rest of my code works just fine.

Any idea what am I doing wrong (e.g. in calling the change_value method), or setting up Tableau, or irt’s really something wrong in trexjacket?

I played around with this a little bit and it looked like the Tableau API expects the “Display As” value, and not the actual value, when setting a parameter value.

This is counter intuitive, and at odds with the fact that the value and allowable_values a parameter will report are both the “Value” not the “Display As” value. But, that is how the Tableau Extension is set up, and is outside of our control!

Does this work if you use Display As instead? Or are you able to remove those Aliases (and handle it elsewhere somehow)?

I’ll open an issue in the Tableau Extensions API but it’s not likely to be resolved quickly on their side.

1 Like

Gosh, that would be pretty annoying indeed… As the display as values are under the Dasboard’s control not the extension’s, and based on your answer as well, the aliases are not returned to the extension to use…

I tried it and it does work if I know the actual aliases and send those to be set. Cheers for the heads up!