PROCESIO
OverviewPlatform ActionsIntegrations & DemosMarketplaceCustom ActionsDeveloper’s Guide

Simple Filter

Filters a simple list (text or numbers) with one rule written in a JSON configuration: exact, contains, similar, fuzzy, sound-alike, word match or regular expression.

The Simple Filter action keeps (or drops) the elements of a simple list — a list of text or numbers — that match one rule. You describe the rule in a small JSON configuration. To filter a list of data models or JSON objects by their fields, use Filter.

Add the action

In the Process Designer toolbox, open List and pick Simple Filter (or type Simple Filter in the search box). Then click Configure to open the configuration panel.

The Simple Filter action properties with the Configure button

Inputs and outputs

FieldDirectionTypeRequiredWhat to put / what you get
List to filterInputList of text or numbersYesThe list to filter, for example ["Apple","apple pie","Banana"].
Filter JSON configurationInputText (JSON)YesThe rule, see below.
Filtered listOutputList of textYesThe elements that passed the rule, in their original order.

The JSON configuration

{
  "MatchType": "Contains",
  "FilterExpression": "apple",
  "KeepIfTrue": true
}
KeyRequiredMeaning
MatchTypeYesHow each element is compared with FilterExpression: Exact, Contains, Similar, Fuzzy, Soundex, SimilarWordMatch or RegEx (not case-sensitive).
KeepIfTrueYestrue keeps the elements that match; false keeps the elements that do not match.
FilterExpressionYes in practiceThe value (or regular expression) to compare with.
FuzzyAlgorithm, FuzzyThresholdOnly for FuzzyThe similarity algorithm and the minimum score from 0 to 1. See Fuzzy.
SoundexDistanceOnly for Soundex0 to 4; 4 (the default) means "sounds the same".
SimilarFirstNwords, SimilarLastNwordsOnly for SimilarWordMatchHow many first / last words must be equal.

Match types

Before comparing, each list element is converted to lower case, double spaces are reduced to one and accents are removed (București becomes bucuresti).

MatchTypeAn element matches when…Example with FilterExpression
ExactIt equals the expression, ignoring case.apple matches Apple, not apple pie.
ContainsIt contains the expression, or the expression contains it (ignoring case).apple matches Apple, apple pie, pineapple. I like cherry juice matches Cherry.
SimilarIt matches after removing spaces, dashes, punctuation, www, http(s) and @; then one contains the other. Two phone numbers match when the digits of one contain the digits of the other.apple-pie matches Apple and apple pie. 376-323-1111 matches 323-1111.
FuzzyIts similarity score with the expression is at least FuzzyThreshold.aple with Levenstein and 0.7 matches Apple.
SoundexIt sounds like the expression in English. Numbers only match numbers and e-mails only match e-mails.Jon matches Jon and John.
SimilarWordMatchIts first N words (or last N words) are the same as those of the expression.apple tart with SimilarFirstNwords: 1 matches Apple and apple pie.
RegExThe regular expression finds a match in it. Always case-insensitive.^[0-9]+$ keeps only the elements made of digits.

Fuzzy

FuzzyAlgorithm takes one of these names, written exactly like this (without spaces): BlockDistance, ChapmanLengthDeviation, ChapmanMeanLength, CosineSimilarity, EuclideanDistance, JaccardSimilarity, DiceSimilarity, Jaro, JaroWinkler, MatchingCoefficient, MongeElkan, Levenstein, NeedlemanWunch, OverlapCoefficient, QGramsDistance, SmithWaterman, SmithWatermanGotoh, SmithWatermanGotohWindowedAffine. An unknown name falls back to Levenstein. FuzzyThreshold is a number from 0 (anything matches) to 1 (identical); 0.7–0.9 is a good starting range. The algorithms are the same as in Similarity Search.

Example

List to filter: ["Apple","apple pie","Banana","Cherry","pineapple","Jon","John","10","25","3"]

Filter JSON configurationFiltered list
{"MatchType":"Exact","FilterExpression":"apple","KeepIfTrue":true}["Apple"]
{"MatchType":"Exact","FilterExpression":"apple","KeepIfTrue":false}every element except Apple
{"MatchType":"Contains","FilterExpression":"apple","KeepIfTrue":true}["Apple","apple pie","pineapple"]
{"MatchType":"Fuzzy","FilterExpression":"aple","FuzzyAlgorithm":"Levenstein","FuzzyThreshold":0.7,"KeepIfTrue":true}["Apple"]
{"MatchType":"Soundex","FilterExpression":"Jon","SoundexDistance":4,"KeepIfTrue":true}["Jon","John"]

With the list ["Apple","10","25","a1","Bob Smith"]:

Filter JSON configurationFiltered list
{"MatchType":"RegEx","FilterExpression":"^\\d+$","KeepIfTrue":true}["10","25"]
{"MatchType":"RegEx","FilterExpression":"^\\D+$","KeepIfTrue":true}["Apple","Bob Smith"]
{"MatchType":"RegEx","FilterExpression":"^[A-Z]","KeepIfTrue":true}["Apple","a1","Bob Smith"] (case-insensitive)

With the list [10,25,3.5] and {"MatchType":"Exact","FilterExpression":"25","KeepIfTrue":true} the result is ["25"]: numbers come back as text.

Good to know

  • Write the FilterExpression without accents. List elements lose their accents before comparison, but the expression does not, so București never matches; use Bucuresti.
  • Backslashes in regular expressions must be doubled inside the JSON: write "^\\d+$" for the pattern ^\d+$. A single backslash makes the configuration invalid JSON and the step fails with The filter JSON configuration setting is not a valid JSON!
  • The result is always a list of text, even when the input list holds numbers.
  • An unknown MatchType does not fail the step: nothing matches, so the result is empty with "KeepIfTrue": true (and the whole list with false).
  • With SimilarWordMatch, set at least one of SimilarFirstNwords / SimilarLastNwords above 0; if both are 0, every element matches.
  • The step fails when: the list is empty (The input list does not have any element!), the list contains data models (The input list is a Data Model! This action can only use simple lists.), or MatchType / KeepIfTrue is missing.

On this page