Use Case: Direct Message on Slack Channel

For the execution of the web action, we will show a very simple example. Let’s define an action that automatically sends a message to a previously defined Slack channel. It is also possible to leverage the fields of the resource on which the call is made. For example, it is possible to insert the ’name’ field of the resource into the message automatically.

Web Action Use Case

The action, as shown in the figure, is defined on the detail pages of the data categories and does not require specific permissions or conditions to be available. In practice, it is a general action for anyone who can operate on the data categories.

In the image below, the configuration is shown in detail, particularly highlighting the required headers for the action.

Web Action Use Case Request Template

In this example we need an authentication token and a content type.

In the image below, the configuration is shown in detail, in particular, we see the headers required for the action:

Web Action Use Case Body

The request body of the example is a JSON that includes the Slack channel to send the message to and the message itself. The notation {{x}} allows for automatic or manual variable assignment during the execution of the action. In the given example, there are 4 variables to be assigned: message, user, dcName, dcUuid. Two of these are extracted from the resource, while the other two are filled in by the user.

To associate the variable with its assignment during execution, a template parameter must be defined.

Web Action Use Case Template Params

The “name” field should correspond to the variable in the request body, in this example “message”. We can also provide an optional default value that can be:

  • Defined by the user when the parameter is created
  • A field of the resource, for example by inserting the “name” field as the default value, the variable will be automatically filled with the “name” field of the resource if present.

The input mode is manual since it is the user who fills in the message and the field is not mandatory, therefore Mandatory is false.

Web Action Use Case Template Params Filled

The action configured in this way is available on the detail page of the data category.

Web Action Use Case Dc Page

Clicking on the icon shown in the figure opens the form for execution.

Web Action Execution Form

By clicking on the Execute button, you can choose the desired configuration through the dedicated form:

The form consists of the configuration selection menu, the target URL, and the parameters to be entered. In the defined example, there are four different parameters, two of which are filled in automatically and two filled in manually.

The user, therefore, enters their own name in the ‘user’ field and their message in the ‘message’ field. The ‘dcName’ and ‘dcUuid’ fields are automatically populated by extracting them from the resource.

The result form show:

  • Status code
  • The resulting headers from the request. These can be expanded to see more details by clicking the arrow icon next to “Headers”.
  • Response Body

Here the final result:

Web Action Result