The ApplicationRoot keyword is used to retrieve a text value that contains the URL root-path of the portal.

Mainly useful for the preview as that includes the portal-id in the url.

This function is SQL compatible. For more information about SQL compatibility, see our documentation.

Returns a text value containing the root-path of the application (excludes the hostname).

In Preview, it will yield the portal-id like "/{portal-id}" In Staging/Live runtimes, it will yield an empty string.

Combined with the function HostName() you can create a deeplink to a certain navigation item by its Path Name that will work in Preview (having the portal-id) as well as in Staging and Live



In Preview, your application will show{portal-id}?sv={session} ApplicationRoot => "/123456" where 123456 is your portal id.

hostname() + applicationroot + "/path-to-navigationitem" => "" on Preview => "" on Staging => "" on Live

Last updated