Load web resource

The load web re-source behaviour provides data from a URL-defined data source via the specified decoder, which is passed to the actions on 'true'. The URL is evaluated as a calculation expression and can define an absolute or relative path.

The Behaviour type Load web resource should use the specified Decoder to obtain behaviour data from a data source defined by URL, which is passed to the Actions on 'true'. A typical application is the Populate element data to map the data to suitable Form elements.

If the data request fails or if an error occurs while parsing the data, the Actions on 'true' are still executed, but without the expected data. Instead, error messages may be returned as $input.

images/download/attachments/189432018/image-2024-9-30_12-32-3-version-1-modificationdate-1727692322421-api-v2.png

The URL as a Calculation expression can define an absolute or relative path. Relative paths are interpreted based on the URL of the current Lobster Data Platform / Orchestration login. Uploaded content can therefore only be read as a web resource if it is stored within the web-folder (see File manager), which has read access, even without logging in.

Depending on the selected Decoder, further parameters may be selectable (see screenshot above):

Decoder

Description

CSV

The CSV decoder parses the returned data as CSV format with the separator specified in the Delimiter parameter (for columns within a row).

The escape character defined in the Escape char parameter allows the use of the column separator (Delimiter) as a regular text character by enclosing the text for the relevant column between two escape characters.

In the first row of the CSV data, the names of the data fields are always expected in the corresponding number and order ('column headers'). Columns for which no name is specified are skipped, so that the generated object does not reflect their contents in the behaviour data (see second record in the example).

Example:

CSV data with default Delimiter and Escape char
id,type,description
1,doorL_rd_el,"Door (left), RED, with powered window
2,doorR_rd_el,Door (right), RED, with powered window

This data yields the array object shown below in JSON format with two entries:

Object in JSON format
[ {
"id": "1",
"type": "doorL_rd_el",
"description": "Door (left), RED, with powered window"
},
{
"id": "2",
"type": "doorR_rd_el",
"description": "Door (right)"
}
]
  • In the second data set, the escape characters for the description field were missing, so the content was cut off at the first separator (comma). The following text is ignored as 'unmarked columns' content.

CLIENT

The client XML decoder processes native XML format (without reference to type information) as it can be interpreted and processed by the browser.

Example: A list data structure similar to the CSV example could look like this as (client) XML:

<items>
<item><id>1</id><type>doorL_rd_el</type> ... </item>
<item><id>2</id><type>doorL_rd_el</type> ... </item>
</items>

Of course, more complex data structures that do not have a list structure can also be loaded in XML format.

SERVER

The server XML decoder expects an XML format that is type-safe, as used in all export formats in Lobster Data Platform / Orchestration.

JSON

The JSON decoder processes data in JSON format, as shown in the CSV example to represent the parsed object.

TEXT

This option copies any text directly into the behaviour data without parsing or interpreting it.

BYTE_ARRAY

Returns the bytes of a file returned by the resource directly (ByteArray type).