Application tiles

Introduction

Application tiles are used to build the UI displayed to the users of an application. For a broader introduction on tiles and applications, see the Dataiku apps tutorial.

Tiles

Upload file in dataset

The Upload file in dataset tile lets users modify the configuration of an Uploaded files dataset. The available interactions are:

  • Go to dataset settings: the tile gives access to the Settings tab of the selected dataset.

  • Only upload file: the tile allows selecting or deleting files.

  • Upload file and automatically redetect format: same as the Only upload file mode but also automatically detects the format.

  • Upload file and automatically redetect format and infer schema: same as the Upload file and automatically redetect format mode but also automatically infers the schema.

Edit dataset

The Edit dataset tile lets users modify the configuration of an Editable dataset. The tile gives access to the Edit screen of the selected dataset.

Edit dataset settings

The Edit dataset settings tile lets users modify the configuration of a dataset. The tile gives access to the Settings tab of the selected dataset.

Replace input dataset

The Replace input dataset tile lets users replace a flow input dataset, for the current app instance.

The tile can target:

  • a specific input dataset selected in the tile configuration

  • an input dataset selected by the application user at runtime

Only replaceable input datasets are available. A replaceable input dataset is a dataset used as a flow input, with no upstream dataset in the flow and at least one downstream recipe.

Replacement sources can come from:

  • a dataset in a project

  • a dataset in a catalog collection

  • a table in a connection

For each source type, the tile can either be restricted to a configured list of projects, collections, or connections, or let the application user choose them at runtime.

When a replacement is applied, DSS rewires every recipe input that used the selected input dataset to instead use the replacement source, for the current app instance. If the replacement source is a connection table, DSS first creates a dataset for that table in the app instance project, then rewires the downstream recipe inputs to that dataset.

You can configure the tile to require schema compatibility between the input dataset and the replacement source. In that case, the schemas must have the same columns in the same order, with identical names and types. When schema compatibility is required, non-matching project and catalog collection sources are filtered out. For connection tables, schema compatibility is checked when the selected input dataset is replaced.

Select dataset files

The Select dataset files tile lets users modify the configuration of a Filesystem dataset. The available interactions are:

  • Go to dataset settings: the tile gives access to the Settings tab of the selected dataset.

  • Only browse file: the tile allows browsing and selecting a file.

  • Browse file and automatically redetect format: same as the Only browse file mode but also automatically detects the format.

  • Browse file and automatically redetect format and infer schema: same as the Browse file and automatically redetect format mode but also automatically infers the schema.

  • Modal to browse file and automatically redetect format and infer schema: same as the Browse file and automatically redetect format and infer schema mode but the editor is displayed in a modal.

Select SQL table

The Select SQL table tile lets users modify the configuration of a SQL table dataset. The available interactions are:

  • Go to dataset settings: the tile gives access to the Settings tab of the selected dataset.

  • Only browse table: the tile allows browsing and selecting a file.

  • Browse table and automatically redetect schema: same as the Only browse table mode but also automatically detects the schema.

  • Modal to browse table and automatically redetect schema: same as the Browse table and automatically redetect schema mode but the editor is displayed in a modal.

Upload file in folder

The Upload file in folder tile lets users modify the configuration of a Managed folder. The available interactions are:

  • Go to folder: the tile gives access to the View tab of the selected folder.

  • Upload file: the tile allows selecting or deleting files.

Select folder files

The Select folder files tile lets users modify the configuration of a Managed folder. The available interactions are:

  • Go to folder settings: the tile gives access to the Settings tab of the selected folder.

  • Browser folder location: the tile allows browsing and selecting the folder location.

  • Modal to browse folder location: same as the Browser folder location mode but the editor is displayed in a modal.

Edit project variables

The Edit project variables tile lets users modify the project variables. See Custom variables expansion.

Runtime interactions

The available interactions are:

  • Open modal to edit: the editor is displayed in a modal.

  • Edit inline with explicit save: the editor is inlined in the tile but changes are saved upon clicking on the Save button.

  • Edit inline with auto-save: the editor is inlined in the tile and any change is saved.

Runtime form

The runtime form can either be fully generated by DSS or fully custom. Its capabilities, behavior and definition are exactly the same as forms of plugin components.

Auto-generated form

Auto-generated forms are made of the same parameters as auto-generated forms in plugin components:

  • The corresponding Auto-generated controls JSON editor in the application designer allows directly editing the params field described in Parameters.

  • The corresponding project variable will be named after the name field of the parameter.

  • To configure a dynamic select using python:

    1. set getChoicesFromPython to true

    2. click on Use custom UI

    3. create a do() method in the Python helper code code editor that returns a dict with a key “choices” as described in the section Dynamic select using python of the Plugin parameters page

Example:

  • Auto-generated controls

[
        {
                "name": "campaignName",
                "label": "Campaign name",
                "type": "STRING"
        },
        {
                "name": "sendNotification",
                "label": "Send completion notification",
                "type": "BOOLEAN",
                "defaultValue": true
        },
        {
                "name": "runMode",
                "label": "Run mode",
                "type": "SELECT",
                "defaultValue": "full",
                "selectChoices": [
                        { "value": "full", "label": "Full rebuild" },
                        { "value": "incremental", "label": "Incremental update" }
                ]
        },
        {
                "name": "availableCountry",
                "label": "Country",
                "type": "SELECT",
                "getChoicesFromPython": true
        }
]
  • Python helper code

def do(payload, config, plugin_config, inputs):
        run_mode = config.get("runMode", "full")
        if run_mode == "incremental":
                choices = [
                        {"value": "fr", "label": "France"},
                        {"value": "de", "label": "Germany"}
                ]
        else:
                choices = [
                        {"value": "fr", "label": "France"},
                        {"value": "de", "label": "Germany"},
                        {"value": "us", "label": "United States"}
                ]
        return {"choices": choices}
Dataset column value selectors

In addition to these standard parameter types, the Edit project variables tile also supports COLUMN_VALUE and COLUMN_VALUES parameters in auto-generated forms. These parameter types let you populate a single-select or multi-select directly from the values present in a dataset column.

These selectors are useful when the application user should pick business values from a dataset rather than raw values, for example a country, city, category, or product reference.

Warning

COLUMN_VALUE and COLUMN_VALUES are currently only supported in application contexts. They are not supported in:

  • plugin component settings

  • plugin presets edited inline

  • plugin project presets

To configure them, define:

  • a DATASET parameter to select the source dataset

  • one or more DATASET_COLUMN parameters pointing to the columns that contain the values to expose.

  • a COLUMN_VALUE or COLUMN_VALUES parameter using:
    • valueColumnParamName to point to the column from which to fetch the values

    • labelColumnParamName to optionally point to a separate column used as the displayed label

    • filteredByColumnValueParamName to optionally create a dependency on another COLUMN_VALUE or COLUMN_VALUES parameter. The available values will then be filtered by the selected values then be filtered within the same dataset only.

You can set a defaultValue to pre-select a value and use visibilityCondition to hide these parameters from the final user if needed.

DSS retrieves the values for the first 10,000 rows in the dataset. This limit can be modified with the dku.sample.filtering.maxRecords dip property.

Example:

[
        {
                "name": "customersDataset",
                "label": "Customers dataset",
                "type": "DATASET",
                "defaultValue": "customers",
                "visibilityCondition": "false"
        },
        {
                "name": "countryCodeColumn",
                "label": "Country code column",
                "type": "DATASET_COLUMN",
                "datasetParamName": "customersDataset",
                "defaultValue": "country_code",
                "visibilityCondition": "false"
        },
        {
                "name": "cityCodeColumn",
                "label": "City code column",
                "type": "DATASET_COLUMN",
                "datasetParamName": "customersDataset",
                "defaultValue": "city_code",
                "visibilityCondition": "false"
        },
        {
                "name": "cityLabelColumn",
                "label": "City label column",
                "type": "DATASET_COLUMN",
                "datasetParamName": "customersDataset",
                "defaultValue": "city_name",
                "visibilityCondition": "false"
        },
        {
                "name": "country",
                "label": "Country",
                "type": "COLUMN_VALUE",
                "valueColumnParamName": "countryCodeColumn"
        },
        {
                "name": "city",
                "label": "City",
                "type": "COLUMN_VALUE",
                "valueColumnParamName": "cityCodeColumn",
                "labelColumnParamName": "cityLabelColumn",
                "filteredByColumnValueParamName": "country"
        }
]

In this example, the dataset and technical column selectors are pre-filled and hidden, so the application user only sees the Country and City fields.

To allow several values to be selected, use COLUMN_VALUES instead of COLUMN_VALUE.

Custom form

Custom forms offer more control on the actual form presented to the user. They are defined as html and JS files like in plugin components:

  • The Python helper code code editor allows writing the do() method as described in Fetching data for custom forms of the Custom settings UI page.

  • The Custom UI HTML code editor allows writing the HTML template where the controller is defined in the Javascript code editor.

  • The Custom UI JS code editor allows writing the Javascript where the Angular controller is added to the Angular module.

  • The Angular module text input allows specifying the Angular module.

  • As described in the documentation Custom settings UI, the parameter values, i.e. the values of the project variables, should be set in the object config.

Run scenario

The Run scenario tile lets users run a selected Scenario.

Propagate schema

When changing the input datasets of a flow, columns are often changed. Either their type can change, or columns can appear or disappear. This implies that the definition recipes consuming these datasets no longer matches their inputs, and thus that the recipes may fail to run. User action is then needed to adjust the recipes, updating, adding or removing columns from their definitions. This change can be tedious when for example one column has to be added to all downstream recipes and datasets of a changed input dataset. DSS offer the Propagate schema tool on the flow in order to facilitate this chore. The Propagate schema tile of an application wraps this tool.

The tile can be set to only initiate a schema propagation, leading the application user to the flow and letting them accept each suggested change manually. The tile can also be run automatically, without user interaction. In the latter mode, the application designer can pre-define some actions to take on the recipes in the Recipe update options, and also define recipes to not take action on at all:

  • “Excluded recipes” is a list of names of recipes that the propagation should simply not consider. The propagation will stop at this recipe and not proceed further. For example, model training recipes should generally be excluded.

  • “Recipes marked as OK” is a list of names of recipes that the propagation can consider as fine. Since propagation relies on design-time inspection of the recipes, some recipe types, notably code-based recipes, can’t compute the schema of their outputs without running or potentially expensive computations; for such recipes, the propagation tool, when run interactively, will ask for the user to double-check manually and mark as OK. When marked as OK, the automatic propagation will not seek approval from the user and just continue the propagation

  • “Partition by dimension” (name) and “Partition by computable” (name) offer control on the default values for partition identifiers to use when the propagation needs to rebuild a dataset to compute some schema change downstream, and that dataset is partitioned. This happens for example for Prepare recipes, which need their input to be up-to-date in order to compute a schema.

The Recipe update options is a JSON block of the following structure:

{
        "byType" : {
                "grouping" : {
                        // options for all grouping recipes
                },
                "window" : {
                        // options for all grouping recipes
                },
                "join" : {
                        // options for all join recipes
                },
                "generate_features" : {
                        // options for all grouping recipes
                }
        },
        "byName" : {
                "compute_some_data_by_key" : {
                        // options for the compute_some_data_by_key recipe
                },
                ...
        }
}

Update options for Group

The options available are

{
        "removeMissingAggregates" : true, // drop aggregates of columns no longer present in the input
        "removeMissingKeys" : true, // drop columns no longer present in the input from the grouping keys
        "newAggregates" : {
                "DOUBLE" : [
                        {
                                "column" : "regular expression to filter columns",
                                // if match found, add the following aggregates
                                "min" : true,
                                "avg" : true
                        },
                        ...
                ],
                "BIGINT" : [
                        // rules for added columns of type bigint
                ]
        }
}

Update options for Window

Quite similarly to the Group recipe, the options available are

{
        "removeMissingAggregates" : true, // drop aggregates of columns no longer present in the input
        "removeMissingInWindow" : true, // drop columns no longer present in the input from the partitioning and sorting keys
        "newAggregates" : {
                "DOUBLE" : [
                        {
                                "column" : "regular expression to filter columns",
                                // if match found, add the following aggregates
                                "min" : true,
                                "last" : true
                        },
                        ...
                ],
                "BIGINT" : [
                        // rules for added columns of type bigint
                ]
        }
}

Update options for Join

The options available are

{
        "removeMissingJoinConditions" : true, // drop join conditions involving columns no longer present in the input
        "removeMissingJoinValues" : true, // drop columns no longer present in the input the list of selected columns
        "newSelectedColumns" : {
                "DOUBLE" : [
                        {
                                "table" : 1, // this rule applies to the second input only
                                "name" : "regular expression to filter columns"
                                // if match found, select the column
                        },
                        {
                                "table" : -1, // this rule applies to all inputs
                                "name" : "regular expression to filter columns",
                                "alias" : "alias for the added column, with $1, $2 ... replacements from the regex"
                        },
                        ...
                ],
                "BIGINT" : [
                        // rules for added columns of type bigint
                ]
        }
}

For example, the following rule matches columns ending in _min and outputs them without the _min suffix:

{
        "table" : -1,
        "name" : "^(.*)_min$",
        "alias" : "$1"
}

Update options to generate features

The options available for the Generate features recipe are

{
        "removeMissingRelationships" : true, // drop relationships involving columns no longer present in the input datasets
        "removeMissingSelectedColumns" : true, // drop columns for computation no longer present in the input datasets
        "fixSelectedColumnsVariableTypes" : true // change the selected variable types of the selected columns if it is no longer compatible with the storage type or remove the column if the storage type is irrelevant (i.e. geo types).
}

View dashboard

The View dashboard tile lets users view a dashboard from the current project in the application.

View folder

The View folder tile lets users access the View tab of the selected Managed Folder.

Download dataset

The Download dataset tile lets users download the selected Dataset.

Download report

The Download report tile lets users download the selected R Markdown report.

Download file

The Download file tile lets users download the selected file or folder from the selected Managed folder.

Download dashboard

The Download dashboard tile lets users download the selected Dashboard. See Exporting dashboards to PDF or images.

Variable display

The Variable display tile lets users display variables. The display can be customized using HTML tags. As described in Custom variables expansion variables must be referenced with the ${variable_name} syntax.

Display Markdown text

The Display Markdown text tile lets users display formatted text using Markdown syntax. As described in Custom variables expansion, project variables can be referenced with the ${variable_name} syntax.

Display an image

The Display an image tile lets users display an uploaded image in the application. You can optionally configure a caption, an alt text for accessibility and a maximum image height.