AnvilX configuration context menu without UI button

What I’m trying to do:

I’m trying to add a Configuration pop-up as it is done in other extensions, following the Tableau Extensions documentation. This would allow to have an extra menu-item when setting up the extension in a Tableau dashboard, and not needing a UI element (e.g. a button) always being present, as the AnvilX template does it (a pop-up modal from the extension itself).

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

Following the template extension, it needs the extra button, that I’d like to avoid. And in the AnvilX docs, the Configure but also seem to need the button being present in the interface itself (rather than added to the menu as the Tableau docs show)

Just starting with the configuration based on the doc linked above and adding

<!-- snip;  
  add to <dashboard-extension> or <worksheet-extension> section
  after <icon></icon> 
  and <permissions></permissions> -->
<context-menu>
    <configure-context-menu-item />
</context-menu>

to the sample downloaded .trex file results in an not-loading extension.

I’m guessing if there’s any way in Anvil to set this up, then some additional configuration is needed, but unsure what.

Any pointers are appreciated!

For the time being I worked around this by having a Configuration page, which only does one thing: setting the starting page configuration, which is then loaded and acted up on inside startup.

# [...snip...]
from trexjacket.api import get_dashboard
# [...snip...]

app_role = get_dashboard().settings.get("app_role", "Not set")
if app_role == "Main App":
    open_start_form("Workflow")
elif app_role == "Results Viewer Widget":
    open_start_form("ResultsViewerWidget")
else:
    open_start_form("ConfigureSettings")

This works fine-ish, but to have more than that setting to adjust, this would be an inconvenient way for it:, needing to either

  • re-add the extension to clear the data and allow seeing the config page, or
  • having a navigation button in the UI for that config (valuable real estate)

The configuration approach you tried through modifying the .trex file isn’t supported by Anvil X today, as you discovered.

The approach you’ve adopted (of some form of default routing if settings aren’t set) is how we’ve most often addressed this in the past, coupled with binding the visibility of the settings button to the dashboard being opened in author mode. We’re okay sacrificing the real estate in that case since our users are accessing Tableau dashboards through the server/cloud in “viewer” mode; this might not be your use case.

Could dashboard parameters instead of settings be useful here? These are always editable by the user but I wonder if they might fit instead, if you do have a lot of dashboard users opening your dashboards in author mode.

Oh, that “author” and “viewer” mode sounds interesting that that indeed could fix some of our other UX quirks as well (ie. hiding admin toolbox from regular users).

I’m guessing it’s this one: API Reference — trexjacket documentation

Cheers for the pointer!