Bosch IoT Insights

Upload widget

Using the Upload widget, files can be uploaded in dashboards. The target location of the uploaded files can be configured.

Example

images/confluence/download/attachments/3723092157/widget_upload_example-version-1-modificationdate-1703176625000-api-v2.png

Proceed as follows

  1. Select the Upload widget in the widget list.
    → The widget configuration page is displayed.

    images/confluence/download/attachments/3723092157/Upload_widget_configuration-version-1-modificationdate-1718885526000-api-v2.png
  2. Configure the settings as described below.

  3. Click the Add button.
    → The widget is added to the dashboard.

To create this widget, the following settings are mandatory to be configured:

  • Upload Endpoint Settings

All other settings are optional.

Dashboard Settings

Open the Dashboard Settings pane to set how the widget is displayed in the dashboard.

  1. In the Size drop-down list, decide how much space the widget should take in the form of columns.

  2. In the Visibility drop-down, set whether the widget should be visible or hidden. You can also define for which specific roles the widget will be shown or not. This setting allows you to customize dashboards for specific user groups that have a certain role.

    Visible: The widget is visible for all (default)
    Visible for roles: The widget is visible if any of the selected roles matches one of the user's project role
    Hidden: The widget is hidden for all
    Hidden for roles: The widget is hidden if any of the selected roles matches one of the user's project role

  3. In the Layout behavior drop-down list, decide how the size of the widget should be adapted in the dashboard.

  4. In the Title field, enter a title for the widget.

    For a dynamic title, you can add placeholders with the ${...} notation. Possible placeholder sources are filterParams (if a filter widget exists on the dashboard, e.g. ${filterParams.paramName}) or data from the data source (if source is specified, e.g. ${[0].payload.value}), insights (user context), dashboardName or widgetId.

Data Sources

Open the Data Sources pane to configure the data source for the widget.

You can select a maximum of three data sources.

  1. Click the + Add Source button to add a data source.

  2. Select any of the following options further explained underneath:

Query Template

  1. In the Query Template drop-down list, select a query template that you configured under Explore > Data Explorer, refer to Creating a query template.

    A query template is a template that has been created, parameterized, and provided for others. It is similar to an SQL View and shows data in a table view.

    To connect the widget with the Filter Panel widget you created for this dashboard, click the Available references icon images/confluence/download/thumbnails/1083888325/icon_reference-version-1-modificationdate-1616506558000-api-v2.png and select the Filter Panel.

    If you have a time parameter, you can choose between absolute time, relative time, and a preset by clicking the time icon images/confluence/download/thumbnails/1083888325/icon_absolute_relative_time-version-1-modificationdate-1616506558000-api-v2.png .

    There is a Target collection parameter, if the selected query template allows multiple target collections. Select one of the allowed collections from the drop-down list, or select a dynamic reference using the Available references icon images/confluence/download/thumbnails/1083888325/icon_reference-version-1-modificationdate-1616506558000-api-v2.png .

  2. For Caching, add the Duration in seconds to load existing cache entries that match your parameters during that time frame.

    The default cache time of 30 minutes is set automatically.

  3. Click the Source data preview icon images/confluence/download/thumbnails/1083888325/refresh%281%29-version-1-modificationdate-1725282826000-api-v2.png to open a preview.

  4. Click the Save Data Source button.

Single Device

  1. In the Default Device ID drop-down list, select a Device ID.

    To connect the widget with the Filter Panel widget you created for this dashboard, click the Available references icon images/confluence/download/thumbnails/1083888325/icon_reference-version-1-modificationdate-1616506558000-api-v2.png and select the Filter Panel.

  2. Click the Source data preview icon images/confluence/download/thumbnails/1083888325/refresh%281%29-version-1-modificationdate-1725282826000-api-v2.png to open a preview.

  3. Click the Update Source button.

Multiple Devices

  1. In the Select Device Types drop-down list, select a device type.

  2. Click the Advanced Settings button to narrow down the output.

  3. In the Start field, enter a value to specify the device to start with.

    Example: If you select 3, the first two devices are skipped.

  4. In the Limit field, enter a value to specify the last device.

    The maximum is 200 devices.

  5. In the Fields field, enter the fields whose information shall be retrieved from Bosch IoT Things.

  6. In the Sort field, enter a field configured in Bosch IoT Things according to which the data shall be sorted.

  7. In the Namespaces field, add namespaces separated by a comma.

  8. In the Filter field, add a filter to narrow down the search results. Placeholders are also supported.

  9. Click the Source data preview icon images/confluence/download/thumbnails/1083888325/refresh%281%29-version-1-modificationdate-1725282826000-api-v2.png to open a preview.

  10. Click the Update Source button.

Device Count

The Device Count data source is based on the counting functionality in Bosch IoT Things and is used to count things.

  1. In the Select Device Type drop-down list, select the device types/devices to be used as data source.

    • All Devices: Counts all devices regardless of the fact that they have a device type or not

    • All Device Types: Counts the devices that have the thing attribute type which means that the device belongs to a device type

    • Without Device Type: Counts the devices without the thing attribute type

    • Device Type xy: Counts the devices of the selected device types

  2. Click the Advanced Settings button to narrow down the output.

  3. In the Namespaces field, add namespaces separated by a comma.

  4. In the DefaultFilter field, add a filter to narrow down the search results.

    To connect the widget with the Filter Panel widget you created for this dashboard, click the Available references icon images/confluence/download/thumbnails/1083888325/icon_reference-version-1-modificationdate-1616506558000-api-v2.png and select the Filter Panel.

  5. Click the Source data preview icon images/confluence/download/thumbnails/1083888325/refresh%281%29-version-1-modificationdate-1725282826000-api-v2.png to open a preview.

  6. Click the Update Source button.

Devices from Filter Selection

Devices will be loaded that match the Device filter type configured in the Filter Panel widget.

  1. In the Pagination Limit field, enter a limit of devices that shall be displayed per page.

  2. In the Sort field, enter a property according to which the devices shall be sorted.

  3. Click the Source data preview icon images/confluence/download/thumbnails/1083888325/refresh%281%29-version-1-modificationdate-1725282826000-api-v2.png to open a preview.

  4. Click the Update Source button.

Playback: All Frames

The Playback widget must have been configured for your dashboard.

  1. Select Playback: All Frames to display all data that has been recorded.

Playback: Current Frame

The Playback widget must have been configured for your dashboard.

  1. Select Playback: Current Frame to display the data that is just being recorded.

External Data Source

Using the external data source, an external endpoint can be specified to reference data.

  1. Select an HTTP method.

  2. In the Request URL field, enter the URL of the request.

  3. In the Type drop-down list, select the type of authorization.

  4. Click the Set Configuration button to set up the selected authorization.

    1. For Basic Auth:

      1. In the Username field, enter the username.

      2. In the Password field, enter the password.

    2. For OAuth 2.0

      1. In the Grant Type drop-down list, select the type of credentials.

      2. Enter the Access Token URL.

      3. Enter the Client ID.

      4. Enter the Client Secret.

      5. If you selected Password Credentials as Grant Type, also enter the Username and the Password .

    3. For OAuth 2.0 (On-behalf grant type)

      1. In the Grant Type drop-down list, select Azure AD On-Behalf.

      2. Configure the scopes of your application API as described in External data source: on-behalf-of (OBO) flow.

  5. If you selected the GET HTTP method:

    1. In the Headers pane, enter a key and a value to specify the header information of the external system.

    2. Activate the Secret Header checkbox to flag the header as secret.

      When editing the data source, the header information has to be provided.

    3. In the Test Parameters pane, enter a filter parameter to test it.

      This pane can be used if a filter widget is configured for the dashboard. The filter values can be referenced as described in this pane within the URL and Headers.

      Modifiers can be used to manipulate referenced filter values. The following modifiers are available:

      • noencode: Only used in URLs. The value is not encoded as it is done by default.

      • join: Concatenates multiple values in one string separating them with the provided separator.

      • replace: Replace multiple occurrences of a search pattern with a specified replacement pattern.

      • queryParams: Creates an entry with the provided parameterName for each value.

      • relativeTimestamp: Calculates a relative time according to the current time. It offers a way to dynamically change the time range with the use of the Filter Panel widget, e.g. gt{$filterParams.dateTime.from | relativeTimestamp}

      • addTime:<insert number in milliseconds>: Calculates the relative time according to the given time from insights.timestamp and using the number from addTime, e.g. gt{insights.timestamp | addTime:-300000}. This modifier is designed for static usage so that a Filter Panel widget is not required. A positive number is also allowed if relevant.

      Usage examples:

      Example filter context: 

        "multi": ["v1", "v2"],

        "mixedValues": ["v1", undefined, "v2"]

      }

      join:

      ${filterParams.multi | join: ','} will result in v1,v2

      replace:

      ${filterParams.mixedValues | replace: 'undefined','N/A'} will result in ["v1","N/A","v2"]

      queryParams:

      ${filterParams.multi | queryParams: 'multiParam'} will result in multiParam=v1&multiParam=v2

      Independently from the test parameters, user-specific information and randomly generated sequences (UUID v4, alphanumeric or hex string) can be referenced.

  6. If you selected the PUT HTTP method:

    1. In the Body pane, select the type of data in the Type drop-down list.

    2. Activate the Secret Header checkbox to flag the header as secret.

      When editing the data source, the header information has to be provided.

    3. In the Test Parameters pane, enter a filter parameter to test it.

      This pane can be used if a filter widget is configured for the dashboard. The filter values can be referenced as described in this pane within the URL, Headers and the Body.

      Modifiers can be used to manipulate referenced filter values. The following modifiers are available:

      • noencode: Only used in URLs. The value is not encoded as it is done by default.

      • join: Concatenates multiple values in one string separating them with the provided separator.

      • replace: Replace multiple occurrences of a search pattern with a specified replacement pattern.

      • queryParams: Creates an entry with the provided parameterName for each value.

      • relativeTimestamp: Calculates a relative time according to the current time. It offers a way to dynamically change the time range with the use of the Filter Panel widget, e.g. gt{$filterParams.dateTime.from | relativeTimestamp}

      • addTime:<insert number in milliseconds>: Calculates the relative time according to the given time from insights.timestamp and using the number from addTime, e.g. gt{insights.timestamp | addTime:-300000}. This modifier is designed for static usage so that a Filter Panel widget is not required. A positive number is also allowed if relevant.

      Usage examples:

      Example filter context: 

        "multi": ["v1", "v2"],

        "mixedValues": ["v1", undefined, "v2"]

      }

      join:

      ${filterParams.multi | join: ','} will result in v1,v2

      replace:

      ${filterParams.mixedValues | replace: 'undefined','N/A'} will result in ["v1","N/A","v2"]

      queryParams:

      ${filterParams.multi | queryParams: 'multiParam'} will result in multiParam=v1&multiParam=v2

      Independently from the test parameters, user-specific information and randomly generated sequences (UUID v4, alphanumeric or hex string) can be referenced.

  7. If you selected the POST HTTP method:

    1. In the Body pane, select the type of data in the Type drop-down list.

    2. Activate the Secret Header checkbox to flag the header as secret.

      When editing the data source, the header information has to be provided.

    3. In the Test Parameters pane, enter a filter parameter to test it.

      This pane can be used if a filter widget is configured for the dashboard. The filter values can be referenced as described in this pane within the URL, Headers and the Body.

      Modifiers can be used to manipulate referenced filter values. The following modifiers are available:

      • noencode: Only used in URLs. The value is not encoded as it is done by default.

      • join: Concatenates multiple values in one string separating them with the provided separator.

      • replace: Replace multiple occurrences of a search pattern with a specified replacement pattern.

      • queryParams: Creates an entry with the provided parameterName for each value.

      • relativeTimestamp: Calculates a relative time according to the current time. It offers a way to dynamically change the time range with the use of the Filter Panel widget, e.g. gt{$filterParams.dateTime.from | relativeTimestamp}

      • addTime:<insert number in milliseconds>: Calculates the relative time according to the given time from insights.timestamp and using the number from addTime, e.g. gt{insights.timestamp | addTime:-300000}. This modifier is designed for static usage so that a Filter Panel widget is not required. A positive number is also allowed if relevant.

      Usage examples:

      Example filter context: 

        "multi": ["v1", "v2"],

        "mixedValues": ["v1", undefined, "v2"] 

      }

      join:

      ${filterParams.multi | join: ','} will result in v1,v2

      replace:

      ${filterParams.mixedValues | replace: 'undefined','N/A'} will result in ["v1","N/A","v2"]

      queryParams:

      ${filterParams.multi | queryParams: 'multiParam'} will result in multiParam=v1&multiParam=v2

      Independently from the test parameters, user-specific information and randomly generated sequences (UUID v4, alphanumeric or hex string) can be referenced.

  8. In the Duration in seconds field under Caching, specify the caching duration in seconds.

  9. Click the Source data preview icon images/confluence/download/thumbnails/1083888325/refresh%281%29-version-1-modificationdate-1725282826000-api-v2.png to open a preview.

  10. Click the Save Data Source button.

Data Transformation

With the data transformation activated, you can select entries from arrays in arrays or a specific range of arrays.

Also refer to the JMESPath documentation.

Open the Data Transformation pane to activate the data transformation to JMES.

  1. Activate the toggle switch.

  2. In the Filter field, add a string to filter the data, e.g. [0] to display only the first item or [?contains(thingId,'yourThingName')] to filter by contains in the thingId property.

  3. Click the Transformed data preview icon images/confluence/download/thumbnails/1081316247/refresh%281%29-version-1-modificationdate-1725282802000-api-v2.png to open a preview.
    → The data transformation is activated for the widget.

If you selected more than one data source, the Data Aggregator pane is displayed.

  1. Activate the toggle switch.

  2. In the Data Aggregator drop-down list, select an aggregation method with which each entry of the same index is merged into one result.

  3. Activate the Merge Properties checkbox to merge the properties of the index.

  4. In the Filter field, add a string to filter the data, e.g. [0] to display only the first item or [?contains(thingId,'yourThingName')] to filter by contains in the thingId property.

  5. Click the Transformed data preview icon images/confluence/download/thumbnails/1081316247/refresh%281%29-version-1-modificationdate-1725282802000-api-v2.png to open a preview.
    → The data transformation is activated for the widget.


Upload Behavior Settings

Open the Upload Behavior Settings pane to configure the MIME file type, upload format, and upload behavior.

  1. In the MIME type drop-down list, select a MIME file type which is used for file format selection. Alternatively, keep the default option All file types.

    If no MIME type is selected, the file format will be automatically detected.

  2. There is an additional field called Upload format, when you have selected Custom endpoint as Upload destination, refer to Upload Endpoint Settings.
    When that is your case, in the mentioned Upload format field, expand the drop-down list and select one of the available formats for your upload:

    1. Multipart - this option allows you to upload data of several types in a single request, for example, a file along with a JSON object
      If you select this option, there is an additional field called Multipart file key where you need to enter the respective value.

    2. Binary - this option allows you to upload files in binary format

    3. TUS Resumable Upload - this option allows you to upload large files without losing the progress in case of network interruptions
      If you select this option, there is an additional field called TUS chunk size (in MB's), where you need to define the upload increment in MB. The allowed chunk size is between 1 MB and 100 MB.

      Please, note that if you would like to use this upload format, your endpoint must support the tus protocol. For details, refer to the tus protocol documentation.

  3. Activate the Allow multiple file uploads toggle to enable the upload of more than one file at once.

  4. Activate the Clear completed upload results before starting new uploads toggle to remove the results of previous uploads automatically when a new upload is started.

  5. Activate the Disable on specific condition toggle to disable the button if the configured conditions apply.

    1. In the Property Path field, enter a property path where a condition shall be set.

    2. Select an operator.

    3. In the Data Type field, select a data type for the condition.

    4. In the Value field, enter any value at which the button shall be disabled depending on the data type you selected.

      This field can be left empty or set to undefined to disable the button if there is no value available.

    5. Click the Add button to add another condition.

    6. In the Compound Logic Editor, decide if the conditions should be combined by and or or.

Upload Endpoint Settings

Open the Upload Endpoint Settings pane to configure a target endpoint.

There, click the Upload destination drop-down list to define where files should be uploaded to. Select one of the available options:

  • Custom endpoint

  • Input history

  • Device attachment

Each option is explained below.

Custom endpoint

  1. If you selected Custom endpoint, proceed as follows:

    1. Select an HTTP method.

      If you have chosen TUS Resumable Upload in the Upload Behavior Settings pane above, only POST is allowed as an HTTP method.

    2. In the Request URL field, enter the URL of the request.

    3. In the Request timeout in seconds field, enter a value to specify the time in seconds before the server marks the connection as idle and shuts it down.

    4. In the Queuing timeout in seconds field, enter a value to specify how long the executed call should wait to acquire a read ticket before terminating with a timeout.

    5. In the Type drop-down list, select the type of authorization.

    6. Click the Set Configuration button to set up the selected authorization.

      1. For Basic Auth:

        1. In the Username field, enter the username.

        2. In the Password field, enter the password.

      2. For OAuth 2.0

        1. In the Grant Type drop-down list, select the type of credentials.

        2. Enter the Access Token URL.

        3. Enter the Client ID.

        4. Enter the Client Secret.

        5. If you selected Password Credentials as Grant Type, also enter the Username and the Password .

      3. For OAuth 2.0 Bearer Token, add a Token.

      4. For Current User Session, there is nothing to add.

        Current user session only works for service domains that belong to the current project and not 3rd Party applications.

    7. If you selected the PUT HTTP method:

      1. In the Body pane, select the type of data in the Type drop-down list.

      2. In the Headers pane, activate the Secret Header checkbox to flag the header as secret.

        When editing the data source, the header information has to be provided.

      3. In the Test Parameters pane, enter a filter parameter to test it.

        This pane can be used if a filter widget is configured for the dashboard. The filter values can be referenced as described in this pane within the URL, Headers and the Body.

    8. If you selected the POST HTTP method:

      1. In the Body pane, select the type of data in the Type drop-down list.

      2. In the Headers pane, activate the Secret Header checkbox to flag the header as secret.

        When editing the data source, the header information has to be provided.

        • If you have selected TUS Resumable Upload in the Upload Behavior Settings pane above, here is an additional pane called TUS Upload Metadata Header.
          It has default key-value pairs, namely fileName: ${file.name} and fileType: ${file.type}, which are editable. It is also possible to add custom key-value pairs, including such with placeholders for the values, for example data source, filterParams, etc.
          Once these are configured, the frontend will automatically encrypt the values using base64 encoding and will construct the appropriate Upload-Metadata header for the upload.
          Example: Upload-Metadata: fileName dGVzdA==,fileType aW1hZ2UvcG5n,custom MTIzNA==

      3. In the Test Parameters pane, enter a filter parameter to test it.

        This pane can be used if a filter widget is configured for the dashboard. The filter values can be referenced as described in this pane within the URL, Headers and the Body.

In addition to the standard placeholders available for use in Custom Endpoint configuration, you also have the option to retrieve specific file data through the following variables:

  • ${file.name} - represents the name of the currently uploaded file.

  • ${file.lastModified} - denotes the timestamp indicating when the file was last modified.

  • ${file.type} - represents the file type, such as "image/png"

  • ${file.selectionUUID} - unique id for the current selection

  • ${file.selectionDate} - date when the user selected the file - ISO timestamp incl. milliseconds

  • ${file.selectionIndex} - index based on the files in one selection action of the user - always starts with 0

  • ${file.selectionCount} - count of files the user selected in the selection action

Input history

If you selected Input history, proceed as follows:

  1. In the Custom Metadata pane, define the meta data for the input history entries.

    1. Click the Add Metadata Entry button to add an entry.

    2. Enter a Key, e.g. version or device.

    3. Enter a Value.

    4. To add another entry, click the Add Metadata Entry button.

  2. In the Device IDs pane, enter the device IDs to the input history entries to be uploaded.

    1. Enter a comma-separated list of device IDs which should be linked to the uploaded input data.

Device attachment

If you selected Device attachment, proceed as follows:

  1. In the Type drop-down list, select the device type for which an attachment shall be uploaded.

  2. In the Attachment block drop-down list, select an attachment information block.

  3. In the Device ID field, enter a device ID.

The device ID can be configured with placeholders.