25 Apr 2023
11:40 AM
- last edited on
02 May 2023
02:32 PM
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.
25 Apr 2023 12:04 PM
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.
26 Apr 2023 05:21 PM
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.