In the previous chapter we talked about 3 main types of Catalog assets (datasets, web pages, and files) and how they can be retrieved. This chapter explains how catalog assets can be hyperlinked in a way that closely resembles hyperlinking in web pages.
Asset hyperlinking is a powerful technique that enables interconnecting and automating disparate data and systems, very much like web page hyperlinking enabled the world-wide web. You can browse related data in various systems, modify it, and trigger different actions with it right from the Catalog, just like you can browse various websites with a web-browser.
Asset commands
Asset hyperlinking is done with the help of asset commands available in computed assets of type "Dataset". In a nutshell, an asset command simply retrieves another Catalog asset, be it a dataset, a web page, or a file. A command can also trigger a workflow, a special asset type that doesn't return anything and is explained later in this chapter. There are 3 types of commands:
- Row commands (invoked from a row)
- Column commands (invoked from a column)
- General commands (invoked from a dataset)
To add an asset command, select "Add/edit commands" in the asset's context menu (see image below).
Row commands
A row command is invoked by right-clicking a cell value (see below). Usually, it retrieves another asset that corresponds to the clicked value. For example, you can click an order number and retrieve a related dataset (asset) that contains all the products in that order.
For such a command to work, the retrieved dataset: a) must be calculated (i.e. use a workflow to produce a result dataset), and, b) must have a parameter that is an order number. In the command properties, the parameter should be assigned with values of the column that contains order numbers.
Note that in the example described above, the orders can come from one system (e.g. CRM), but the list of products can be obtained from another (e.g. inventory). However, from the user perspective, it doesn't matter — all the required data is linked and is accessible with a single click, no matter where it's actually stored.
If a row command is defined in asset settings, every row in the dataset will have exactly the same set of row commands. In other words, if a row command is available in one row, it's available in any other row of the same dataset. Row commands are quite flexible:
- A row command can retrieve an asset of any type (dataset, web page, file, etc.)
- Different commands can be assigned to different row values (values in different columns of the same row)
- A row command can use multiple values from the same row (and pass it as parameters to the retrieved asset)
- A row value can have multiple commands (as in the image above)
- If a row command retrieves a web page, or a file (but not a dataset), or triggers a workflow, it can point to a module in the current asset, instead of another asset
Hint: Row commands of Catalog assets are very similar to row commands of Launcher tasks
Column commands
Columns commands, unlike row commands, operate with multiple rows at once. Similarly to a row command, a column command also retrieves another asset and assigns its parameter(s) with values from the current dataset. However, a column command assigns to a parameter not a single value from a row, but all values of a particular column (separated by comma, by default, or another specified delimiter). In a typical use case, a dataset is retrieved and filtered in the Dataset Viewer (as described in the previous chapter). Then, for the selected subset of rows, a column command is applied.
For example, you can retrieve a list of orders, apply filters to only keep pending orders that haven't been paid for a week or longer, and then use a column command to send all of them at once a reminder about the pending payment.
Column commands are invoked by right-clicking a column header in the Dataset Viewer.
General commands
A general command also retrieves another asset (of any type) but it is not linked to a cell or row. It is related to the (dataset) asset in general. When general commands have been configured, they are available by pressing the "Execute command" button on the main toolbar of the Dataset Viewer. The parameter(s) of the asset retrieved by a general command can be assigned with the parameter(s) of the current asset (the asset in which the command is configured). That's how you pass a context (e.g. a date) from one asset to another.
Workflow assets
Workflows are a special Catalog asset type. It doesn't return anything, so technically it can't be "retrieved", it can only be "triggered". A workflow asset simply runs an EasyMorph project. Like any computed asset, a workflow asset can assign project parameters before its execution.
Workflow assets are typically used when you need to perform some kind of action, instead of retrieving data. For instance:
- Send emails
- Push data into a web API
- Run a script or an external application