21min

List filter simple

List filter simple will give you the ability to filter lists used in your process.

Scenario

The user will merge two lists that contain furniture items and needs to know how many items of a certain type he has, in our example we will keep track of the number of couches.

How toο»Ώο»Ώ

Step 1. Create a new process and give it a name.

Document image
Document image
  • ο»Ώ<%list1%> - list of strings of type input, we will provide the following default values.
Text
|
  • ο»Ώ<%list2%> - list of strings of type input, we will provide the following default values.
Text
|
  • ο»Ώ<%count%> - integer variable of type output.
  • ο»Ώ<%outputList%> - list of strings of type output.
  • ο»Ώ<%completeList%> - list of strings of type output.

Step 3. Configure the Concatenate lists action.

Document image

Step 4. Configure the List filter simple action.

Document image
JSON
|

Exact: an exact match needs to be validated (=) against FilterExpression

FilterExpression: in our example we will filter using "couch".

The KeepIfTrue setting describes if that particular match is valid if the filter criteria should keep the record or not. If KeepIfTrue = true, then the record will be kept, otherwise, it will not be kept.

Step 5. Configure the Return List Element Count action.

Document image

Step 6. Save, Validate and Run the process.

Step 7. Add the input data and click Run.

Document image

Step 8. Click Check instances.

Document image

The variable <%count%> will show us how many couches we had in our combined input lits.

List filter simple Explainedο»Ώο»Ώ

Parameters:

  • Input (required): List<object> to filter
  • Input (required): Configuration - this entry will allow JSON
  • Output (required): List<object> of the filtered items

JSON Configuration:

JSON
|

Match types

Exact: an exact match needs to be validated (=) against FilterExpression.

Similar: it compares against FilterExpression to see:

  • if special characters do not exist, E.g. John-Doe and John Doe are a match (before comparing it replaces special characters and space characters with string.empty)
  • phone numbers E.g. 376-323-1111 and 323-1111 are a match (if after replacing special characters and spaces with string.empty the string contains only numbers, a Field1 contains Field2 OR Field2 contains Field1 assessment is made)
  • regardless of whether WWW, HTTP(s)://, exists to enhance domain or URL comparison
  • if an email is written with @ or " at " or "[at]" should be a match

Fuzzy: this should use the Algos available in StringSimilarity Action to compare the field against FilterExpression (read this for more details).

Contains: this checks if Field contains FilterExpression OR FilterExpression contains Field.

Soundex: this checks if the Field and FilterExpression are similar if you would speak them. See complementation example. This matching algorithm evaluates the distance in β€œsounding” on a scale from 0 to 4, where 4 means the most similar β€œsounding” and 0 means that the words are very different.

SimilarWordMatch: This checks if the first N words in the Field are the same as the first N words in FilterExpression OR if the last N words in the Field are the same as the last N words in FilterExpression.

RegEx: This checks if the Field is a valid match of the pattern from FilterExpression. The RegEx FilterExpression needs to be made JSON safe/encoded (e.g. by using )

FuzzyAlgorithm and FuzzyThreshold properties are only used when MatchType = Fuzzy. If MatchType is something else, those properties will be ignored so, they can be null or can even not be present.

SimilarFirstNwords and SimilarLastNwords properties are only used when MatchType = SimilarWordMatch in which case at least one should be >0. If both are =0 then the SimilarWordMatch will not be executed at all since it does not make sense. If MatchType is something else, those properties will be ignored, so, they can have any value or can even not be present.

SoundexDistance: This is used only when the MatchType = Soundex and it can be set 0, 1, 2, 3 or 4, where 4 means the words are very similar when spoken.

The KeepIfTrue setting describes if that particular match is valid if the filter criteria should keep the record or not. If KeepIfTrue = true, then the record will be kept, otherwise, it will not be kept.

IMPORTANT

  • The matching algorithms work only on Fields that are of type primitive and not on data structures (if the config gives a field that is another JObject/JArray, the Action was not tested in these conditions)
  • a Row Match is TRUE only if all matches are TRUE, so the evaluation looks like this (pseudo-code for the JSON config from above):
Text
|

ο»Ώ