Creating context Actions (Actions executed from grid)

  • Updated

This example will show you how to configure Actions that are to be executed from the grid. The main thing to consider when configuring such as Action is how to capture incoming data.

This example is provided as inspiration only. It must be adapted to your Perfion environment to work. Perfion Support does not assist with such adaptations. Please contact your Perfion Partner or your Perfion consultant if you need assistance.

The incoming data source

When the Action is executed, a data sources named Items is passed to the Action. This data source contains a row for a each of the selected items and the following columns.

Only basic meta data of the items along with the user id of the user who executed the Action is passed to the Action. If any additional feature values are required, these should be queried as part of the Action.

Developing and debugging the Action

As it is not possible to start he Action debugger when executing an Action from the grid, it can be useful to write the incoming Action data source to a CSV file when developing or debugging the Action.

To do this, create a simple Action as the one below with two commands

  1. WRITE.CSV that writes the input to a local file. Or to the application server using the @OutputFileAs = JobLog parameter

  2. SELECT.CSV that reads the written file

Then first run the Action from the grid with the SELECT.CSV marked in Ignore and then you will be able to mark the WRITE.CSV in ignore and start the Action from the SELECT.CSV step. You can now develop or debug the Action while using a correctly formatted input data source.

Querying additional information

Most often, when developing an Action, you will need additional features from the queried items. To do this, it is recommended to the use the SELECT.PERFION.FROMTABLE command.

In the example below, a SELECT.PERFION.FROMTABLE command has been added to the Action.

This command will execute the query specified in the Script column, but adding an IN clause to the WHERE part of the queries that contains all the item IDs from the ItemID column of the data table and matching them against the ID field of the query, resulting in a table that adds the BrandName and Color features to the data table

 

Was this article helpful?

0 out of 0 found this helpful

Comments

0 comments

Article is closed for comments.