website logo
πŸ”­Overview
πŸ’ΌPlatform Actions
πŸ’œIntegrations
🧰Custom Actions
πŸ› οΈDeveloper's Guide
Navigate through spaces
⌘K
πŸ“•Call API
πŸ“•Generate Document
πŸ“•Call Subprocess
πŸ“•Decisional
βš“Decisional Further Reading
πŸ“•Join
πŸ“•Delay
πŸ“•For Each
πŸ“•Get File Data
πŸ“•Map Process Data
βœ‰οΈSend Email
πŸ“¬Inbound email
πŸ“Database
πŸ“Documents
πŸ“DateTime
πŸ“FTP/sFTP
πŸ“Json
πŸ“XPath
πŸ“Lists
πŸ“Numerical
πŸ“Strings
πŸ“Converters
πŸ“Excel
πŸ“Scripting
πŸ“Utilitary
πŸ“Pdf
πŸ“Beta
Docs powered byΒ archbeeΒ 

List filter simple

14min

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
ο»Ώ

Step 2. Add the needed variables.

Document image
ο»Ώ
  • ο»Ώ<%list1%> - list of strings of type input, we will provide the following default values.
Text
|
["couch","chair","couch","bench"]
ο»Ώ
  • ο»Ώ<%list2%> - list of strings of type input, we will provide the following default values.
Text
|
["cupboard","ottoman","couch","bench","stool"]
ο»Ώ
  • ο»Ώ<%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
|
{    
"MatchType":"Exact",    
"FilterExpression":"couch",    
"KeepIfTrue":true
}
ο»Ώ

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
|
{
	"MatchType":"Exact",
	"FilterExpression":"(RegEx)expression",
	"FuzzyAlgorithm":"Levenstein",
	"FuzzyThreshold":0.7,
	"SoundexDistance":4,
	"SimilarFirstNwords":1,
	"SimilarLastNwords":1,
	"KeepIfTrue":true
}
ο»Ώ

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
|
RowMatch is true if:
(Match.IsTrue AND KeepIfTrue.IsTrue) OR (Match.IsNotTrue AND KeepIfTrue.IsNotTrue)
ο»Ώ

ο»Ώ

Updated 19 May 2023
Did this page help you?
Yes
No
PREVIOUS
List filter
NEXT
List ToString
Docs powered byΒ archbeeΒ 
TABLE OF CONTENTS
Scenario
How to
List filter simple Explained