To get the client URL in a Dynamics 365 Power App with JavaScript, use:
Xrm.Utility.getGlobalContext().getClientUrl()
Running this in a browser produces:
![]()
To get the client URL in a Dynamics 365 Power App with JavaScript, use:
Xrm.Utility.getGlobalContext().getClientUrl()
Running this in a browser produces:
![]()

I share practical ideas, tutorials, and videos about AI, AI agents, Microsoft technologies, and the Power Platform.