An idea to help all of you dealing with multiple-environments (DEV, UAT, Production)
Please create a function "HOST()" or "SERVER()"
It would function like USERNAME() but returns the host/server text! ("tableau.mycompany.net" or "tableau-uat.mycompany.net")
- Many of us utilize URL Actions that need to be drive users to different locations based on the environment. Example - UAT workbooks should drive users to UAT links. Production workbooks should have URL actions that drive users to Production links.
- In portal/embedded settings this enables visual queues within a dashboard to indicate if the workbook was being served via UAT or by Prod
Current State, there are only 2 options -
- Change up the URL reference when you publish from UAT to Production (manual, and prone to issues)
- Put your links in a published datasource that points to UAT links in the UAT datasource and points to Production Links in the Production datasource of the same name. (this has one major weakness, accidental publishes of that datasource from UAT to Production results in users being redirected from production to UAT without knowing it)
The link would include a host() calculation. No more manual changes or issues between the environments, the workbook is now "Environment Aware"
if host() = "tableau-uat.mycompany.net" then [UAT Link] elseif host() = "tableau.mycompany.net" then [Prod Link] end