In the previous chapter we talked about 3 main types of Catalog items (datasets, web pages, and files) and how they can be retrieved. This chapter explains how catalog items can be hyperlinked in a way that closely resembles hyperlinking in web pages.
Item 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.
Item hyperlinking is done with the help of item commands available in computed items of type "Dataset". In a nutshell, an item command simply retrieves another Catalog item, be it a dataset, a web page, or a file. A command can also trigger a workflow, a special item 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 item command, select "Add/edit commands" in the item's context menu (see image below).
A row command is invoked by right-clicking a cell value (see below). Usually, it retrieves another item that corresponds to the clicked value. For example, you can click an order number and retrieve a related dataset (item) 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 item 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 item 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 item)
- 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 item, instead of another item
Hint: Row commands of Catalog items are very similar to row commands of Launcher tasks
Columns commands, unlike row commands, operate with multiple rows at once. Similarly to a row command, a column command also retrieves another item 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.
A general command also retrieves another item (of any type) but it is not linked to a cell or row. It is related to the (dataset) item 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 item retrieved by a general command can be assigned with the parameter(s) of the current item (the item in which the command is configured). That's how you pass a context (e.g. a date) from one item to another.
Workflows are a special Catalog item type. It doesn't return anything, so technically it can't be "retrieved", it can only be "triggered". A workflow item simply runs an EasyMorph project. Like any computed item, a workflow item can assign project parameters before its execution.
Workflow items 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