Generic Filter Component
The Generic Filter decides which rows of the incoming data are processed by the rest of the workflow. It is mainly used to filter the rows of an Excel sheet before they are sent to M3: for example, if a column Import says Yes on 5 of 47 rows, only those 5 rows are processed. Each condition checks one field of a row, such as a column, against a value. It is a VXL Live component: you build it in the Vince Platform workflow editor, and the workflow is used from VXL Live.
The M3 Filter works the other way round: it filters what M3 returns, before it is written back to the sheet.
The Generic Filter is meant for VXL Live workflows. In other workflows, filter the data with a JSONata expression in a Transform step instead; see the JSONata Masterclass.
M3 Filter or Generic Filter?
| M3 Filter | Generic Filter | |
|---|---|---|
| Typical use | Filter what M3 returns before it is written back to the sheet, when the M3 transaction can't select precisely enough | Filter the spreadsheet rows coming in before they are sent to M3, for example only the rows marked for import |
| Filters | The output of an M3 API or M3 Fetch step | Incoming rows, such as the rows of the Excel sheet |
| Where it goes | Directly after the M3 API or M3 Fetch step | Before the M3 API step |
| Choosing the field | Picked from the M3 transaction's fields in the Available fields panel | Typed by name, for example a column name |
| Data type | Taken from the M3 field | Chosen per condition: String, Number or Boolean |
| Excel-input workflows | Can apply to all transactions (Global filter) or to one transaction | Applies to the rows it receives |
| Value from | Client (on the run form) or Constant | Client (on the run form) or Constant |
| Combine conditions | And / Or | And / Or |
Example: only the rows marked for import
A sheet has 47 rows of item updates and a column called Import. The user has put Yes in that column on the 5 rows that should be sent to M3.
- Add the Generic Filter before the M3 API step.
- Select Add filter item.
- In Field, type
Import. - Set Comparison to Equal, Source to Constant, Data type to String and Value to
Yes. - Select Save.
When the workflow runs from VXL Live, only the 5 marked rows are sent to M3; the other 42 are skipped. If some users mark rows with 1 instead, add a second item with the value 1 and set Logical operator to Or.
Add a condition
- Select Add filter item. Each item is one condition.
- In Field, type the name of the field to check, for example the column name used in the spreadsheet.
- Choose a Comparison, such as Equal or Greater than.
- Choose a Source and a Data type (String, Number or Boolean).
- Enter the Value to compare against.
- To add more conditions, select Add filter item again and set Logical operator to And or Or on each item to say how it combines with the others.
- Select Save.
Every condition needs a Field. A condition with the source Constant also needs a Value. Use the trash icon to remove a condition.
Comparisons
| Comparison | Keeps the row when the field |
|---|---|
| Equal / Not equal | is, or is not, the value |
| Less than / Less than inclusive | is below the value, or below or equal to it |
| Greater than / Greater than inclusive | is above the value, or above or equal to it |
| Contains / Does not contain | includes, or does not include, the text. Not available for Number. |
| Is blank / Is not blank | is empty, or is not empty |
With Is blank and Is not blank there is no value to enter, and the source is set to Constant automatically.
Source
The source decides where the value comes from.
| Source | Behaviour |
|---|---|
| Client | The person running the workflow enters the value on the execution form. The value you type in the editor is the default. |
| Constant | The value you enter is always used. It does not appear on the execution form. |
A workflow that runs without anyone present, such as a scheduled workflow, has nobody to fill in a value on the execution form. Use Constant for these workflows.
Related
- M3 Filter — filter M3 API output
- Excel — map the spreadsheet that the filter works on
- File Loader — load the file whose rows are filtered