Encode the environment in a variable (ie production vs staging)

  • 1
  • Question
  • Updated 5 months ago
  • In Progress
We would like to create a javascript or SKUID variable that will detect what environment the age is in. The use case is that we have a SKUID portal with embedded tableau iframes, and whenever we refresh the sandbox in order to do some testing, we need to go in and modify all the iframes so they point to the Tableau staging server.

ideally, this variable would detect that it is in a salesforce sandbox and take the value of the Tableau Staging url, ad similarly with production. We would then embed this variable in the iframe so that when it executes it draws from Tableau Staging instead of Prod.
Photo of Santiago Perez

Santiago Perez

  • 362 Points 250 badge 2x thumb

Posted 5 months ago

  • 1
Photo of Mark

Mark

  • 240 Points 100 badge 2x thumb

The Global Merge Variable:

$Site.CurrentSiteUrl

is probably what you're after.

https://docs.skuid.com/v10.0.0/en/skuid/merge-syntax/global-merge-variables.html

You can use it in a formula field:

 {{$Site.CurrentSiteUrl}}

or in a snippet:

skuid.page.currentSiteUrl;

(Edited)