25 Apr 2023
03:40 AM
- last edited on
02 May 2023
06:32 AM
by
educampver
Hi Team,
I need to retrieve and use the environment's URL in a Dashboard/Notebook function.
The docs seems lacking the info on which SDK to import. I tried the following but get an error:
Could you please guide me on using that SDK?
Thanks,
Thomas
Solved! Go to Solution.
Hi Thomas,
@dynatrace-sdk/app-environment
can only be used in apps and is not available for ad-hoc functions.
As an alternative, you can use globalThis.environmentUrl
to access the environment URL.
Thanks Stefan! That works great in ad-hoc functions too.
Just to close the loop, is there a way to use such globalThis properties in a dashboard's markdown tile? Just like we can do via a dashboard variable.
Featured Posts