Open external URL

See also Open external URL (for Event handling) or the ribbon macro command 'Open external URL' (see Available commands).

Actions – Abstract

The Open external URL action opens a URL passed as input value ($input) in a new tab of the client browser.

images/download/attachments/189434883/image-2024-10-17_10-59-40-version-1-modificationdate-1729155579761-api-v2.png

The Open external URL action opens a URL passed as input value ($input) in a new tab of the client browser.

  • The newly opened browser tab immediately receives the focus.

  • The form does not wait until the called page is established. Any subsequent actions are executed immediately.

  • As far as errors occur when opening the URL, they will be displayed in the corresponding browser tab. But they have no influence on the form.

Configuration

The action does not provide any parameters. The URL must be provided directly as an input value ($input).

A simple way to specify a concrete URL is to use the Calculate Behaviour type (see examples below). This can be used for static assignments ('literals' as an expression), but also offers the possibility to build up the URL dynamically per 'calculation expression' (see examples).

IMPORTANT◄ The input value ($input) must be a string, otherwise no browser tab will be opened. Unlike other Lobster Data Platform / Orchestration (see also Open external URL), there is no automatic conversion of other data types (e.g. long or object) to a string.

  • Before being passed to the browser tab, the string is trimmed, i.e. 'separated' from any introductory or trailing whitespace characters (spaces, line breaks, etc.).

  • If the URL does not specify a specific protocol (e.g. http:), the passed text is interpreted as a relative path in the context of the Lobster Data Platform / Orchestration client (see examples).

NOTE◄ A link to a target element is ineffective!

Examples

Simple use case with static URL

Within various forms, the 'Terms and Conditions' (TsCs) should be able to be displayed by clicking on a button. For this purpose, every time the TsCs are updated, a PDF document is created and uploaded by an authorized user with the File manager to a specific subdirectory in the web folder of Lobster Data Platform / Orchestration. The specially created subdirectory public/documents and the file name agb.pdf will always be used:

images/download/attachments/189434883/image2021-2-18_12-16-53-version-1-modificationdate-1729154037453-api-v2.png

By definition, all content placed within the web folder is available as 'subpages' of the client URL.

For access to the TsCs document, the following path is sufficient as 'URL' when accessing from a client form:

  • public/documents/tscs.pdf

Configuration:

In each form that should grant access to the TsCs document, a corresponding Button is placed and equipped with the Behaviour shown on the right:

  • As usual for a Button, the Triggering event Click is set.

  • The Behaviour type Calculate is used here only to define the statically defined URL as an input value for the action by entering the relative path specified above as a literal in the Calculation expression parameter instead of a calculation. This text is always passed as $input to the Actions on "true" at runtime, since the Check expression (optional) parameter is not used.

  • In the Actions on "true" section, the Open external URL action is placed, which does not require any parameterization.

images/download/attachments/189434883/image-2024-10-17_11-2-2-version-1-modificationdate-1729155722554-api-v2.png

Simple use case with 'calculated' URL

Based on the previous use case, it should now be achieved that either the German document agb.pdf or the English version tscs.pdf ('Terms and Conditions') is opened in a specific session, depending on the logon language.

The Localization offers itself to define for each logon language whether the German or the English document should be displayed. Specifically, a custom localization entry is created for this purpose:

images/download/attachments/189434883/image2021-2-18_12-20-35-version-1-modificationdate-1729154037431-api-v2.png

As 'Localization' for the localization entry 'publicDocuments/TERMS_AND_CONDITIONS' different file names can be stored per logon language as shown in the image.

In the configuration from the previous example, only the Calculation expression in the Behaviour type Calculate must then be adjusted so that the URL is established appropriately:

images/download/attachments/189434883/image-2024-10-17_11-3-23-version-1-modificationdate-1729155803447-api-v2.png

  • Per notation [Bundle, Resource] the variable 'language entry' can be attached directly to the unified base path public/documents.

  • At runtime, the document assigned via the Localization for the Current locale will always appear when the Button is pressed.

NOTECompany specific localization could be used in this context to display not only language-specific but also company-specific documents within a more complex company hierarchy always using the same TsCs button.

More complex use case

A portal should forward a search term entered by the user to a company website (here: www.lobster-world.com) and display the search result in a newly opened browser tab.

The Lobster home page supports this access using the following syntax: www.lobster-world.com/<language>//?s=<searchText>.

  • The <language> placeholder must be replaced with a two-character abbreviation for one of the languages supported on the website, e.g. 'de' for German or 'en' for English.

  • The term to be searched for must be passed as the value for the s URL parameter.

Configuration:

In the portal, a Text field for entering the search term and a Combobox for selecting the Locale for the 'Search' are configured as shown on the right.

Two behaviours are set up for the Text field (element #14). The first behaviour 'Enter' triggers the second behaviour 'openURL' when pressing the 'Enter' key in the search field.

The configuration for the 'openURL' behaviour is expanded on the right. Within the Behaviour type Calculate, the Calculation expression is used to build the target URL from the following components:

  • The base URL is defined directly as a literal http://www.lobster-world.com/.

  • As abbreviation for the language the first two characters ($substring( ..., 0,2)) of the internal name for the value in the 'Locale' Combobox ($get($el(15),name)) are extracted.

  • This is followed by another literal (//?s=) that initiates the passing of a value for the URL parameter s, to which the 'search term' from the Text field ($el(14)) of the portal is assigned.

Among the Actions on "True", the Open external URL is added, which does not require any specific parameterization.

images/download/attachments/189434883/image2021-2-18_11-52-19-version-1-modificationdate-1729154037458-api-v2.png