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
πŸ“•Throw
πŸ“•Get File Data
πŸ“•Map Process Data
AWS S3 Operations
βœ‰οΈSend Email
πŸ“¬Inbound email
πŸ“Database
πŸ“Documents
πŸ“DateTime
πŸ“FTP/sFTP
πŸ“Json
πŸ“XPath
πŸ“Lists
πŸ“Numerical
πŸ“Strings
πŸ“Converters
πŸ“Excel
πŸ“Scripting
πŸ“Utilitary
πŸ“Pdf
❀️Community-Made
πŸ“Beta
Docs powered byΒ Archbee
Lists

List filter

10min

List filter will give you the ability to filter complex lists, created with data models, used in your process.

Scenario

The user wishes to check if a certain user of his application/platform has created more than one account, the only way to check is by filtering by phone number. The result should be a list of the accounts that used the specific phone number to register.

How toο»Ώο»Ώ

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

Document image
ο»Ώ

Step 2. Create the data model.

Document image
ο»Ώ

Step 3. Add the needed variables.

Document image
ο»Ώ
  • ο»Ώ<%accounts%> - input variable of type Accounts (the data model we created in the previous step). We will give it as a default value the following, there is one number (+51Β 284Β 665Β 4128) used for two accounts.
JSON
[
   {
      "ID":"a1608f40-47c6-4260-b179-24f30a53acda",
      "Username":"mgaffey0",
      "Email":"swackly0@sun.com",
      "PhoneNumber":"+265 377 450 4783"
   },
   {
      "ID":"72e13c44-20e5-4140-83ca-7cb50751f5e3",
      "Username":"mwinslet1",
      "Email":"wportchmouth1@home.pl",
      "PhoneNumber":"+51 284 665 4128"
   },
   {
      "ID":"9e4a5ab5-0191-4453-a1bc-e4f48c3cd84a",
      "Username":"akunzel2",
      "Email":"omurr2@prlog.org",
      "PhoneNumber":"+63 818 157 4014"
   },
   {
      "ID":"d49ac46c-418b-40d7-9ca8-2c28ed00a5a3",
      "Username":"edreigher3",
      "Email":"tmaccumiskey3@t-online.de",
      "PhoneNumber":"+57 269 859 3614"
   },
   {
      "ID":"22a027fa-6138-47f6-bbe4-dcf3749f8b1d",
      "Username":"mboutell4",
      "Email":"kpatzelt4@craigslist.org",
      "PhoneNumber":"+389 261 201 3357"
   },
   {
      "ID":"5d217bf4-b9d1-4248-a558-3f55b62cfcd5",
      "Username":"tosmond5",
      "Email":"bchafer5@si.edu",
      "PhoneNumber":"+51 284 665 4128"
   },
   {
      "ID":"bb9e8a38-fd04-45e4-a42a-7e84fe6daa9a",
      "Username":"gkemell6",
      "Email":"oskudder6@reuters.com",
      "PhoneNumber":"+52 159 331 8356"
   },
   {
      "ID":"0bd2b1c7-eae8-4bdd-a066-656203196f5e",
      "Username":"emeth7",
      "Email":"ladiscot7@a8.net",
      "PhoneNumber":"+82 982 619 7515"
   },
   {
      "ID":"ce4751f0-56a4-4aa9-8b46-743cd2ab624b",
      "Username":"jmerida8",
      "Email":"oskudder6@reuters.com",
      "PhoneNumber":"+351 835 727 8056"
   },
   {
      "ID":"01ceca10-9fdb-48e2-a689-e8dccca00b39",
      "Username":"acardenosa9",
      "Email":"ckershow9@statcounter.com",
      "PhoneNumber":"+55 722 837 8127"
   }
]
ο»Ώ
  • ο»Ώ<%Result%> - output variable of type Accounts (the data model we created in the previous step).

Step 4. Configure the List filter action.

Document image
ο»Ώ
JSON
{
	"FieldMatches":[
		{
			"FieldName":"PhoneNumber",
			"MatchType":"Exact",
			"FilterExpression":"+51 284 665 4128",
			"KeepIfTrue":true
		}
	]
}
ο»Ώ

FieldName: will specify the "PhoneNumber" as the field we ill check for.

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

FilterExpression: in our example we will filter using "+51Β 284Β 665Β 4128".

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

Step 9. The variable <%Result%> will contain the duplicate accounts.

Document image
ο»Ώ

List filter Explainedο»Ώο»Ώ

Parameters:

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

JSON Configuration:

JSON
{
	"FieldMatches":[
		{
			"FieldName":"Field1",
			"MatchType":"Exact",
			"FilterExpression":"expression",
			"KeepIfTrue":true
		},
		{
			"FieldName":"Field2",
			"MatchType":"Similar",
			"FilterExpression":"expression",
			"KeepIfTrue":true
		},
		{
			"FieldName":"Field3",
			"MatchType":"Fuzzy",
			"FilterExpression":"expression",
			"FuzzyAlgorithm":"Levenstein",
			"FuzzyThreshold":0.7,
			"KeepIfTrue":true
		},
		{
			"FieldName":"Field4",
			"MatchType":"Contains",
			"FilterExpression":"expression",
			"KeepIfTrue":true
		},
		{
			"FieldName":"Field5",
			"MatchType":"Soundex",
			"FilterExpression":"expression",
			"SoundexDistance":4,
			"KeepIfTrue":true
		},
		{
			"FieldName":"Field6",
			"MatchType":"SimilarWordMatch",
			"FilterExpression":"expression",
			"SimilarFirstNwords":1,
			"SimilarLastNwords":1,
			"KeepIfTrue":true
		},
		{
			"FieldName":"Field7",
			"MatchType":"RegEx",
			"FilterExpression":"RegEx expression",
			"KeepIfTrue":true
		}
	],
	"AlternateFields":[
		{
			"FieldName":"Field1",
			"FieldAlternateNames":["Field2","Field3"]
		},
		{
			"FieldName":"Field3",
			"FieldAlternateNames":["Field4","Field1","Field2"]
		}
	]
}
ο»Ώ

MatchType 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 FuzzyThresholdproperties 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 AlternateFields setting describes if the data that normally resides on a certain field might be found in another field as well. The consequence of setting alternate fields for a particular field is that when evaluating a match for a certain field, the same match assessment will be executed for the alternate fields as well and the result of all those alternate matches will be evaluated with OR to determine the result of the overall match. For example, when executing the match for Field1 in the JSON example above ("MatchType":"Exact"), because for Fields1 we have alternate fields ("FieldAlternateNames":["Field2","Field3"]) the same match will be executed for Fields: Fields2 & Fields3 and, to determine if we have a field match for a certain Match setting, the following operation will be executed (pseudo-code):

Text
FieldMatch is true if:
Field1.Match.IsTrue OR Field2.Match.IsTrue OR Field3.Match.IsTrue
ο»Ώ

If Fields1 has the alternate fields Field2 & Field3 does not mean that Field2/Field3 has Field1 as an alternate field.

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.

The matching algorithms work only on Fields that are of type primitive and not on data structures. 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:
(
	(
		Field1.KeepIfTrue.IsTrue AND
		(Field1.Match.IsTrue OR Field2.AlternateField.Match.IsTrue OR Field3.AlternateField.Match.IsTrue)
	) OR (
		Field1.KeepIfTrue.IsNotTrue AND
		(Field1.Match.IsNotTrue AND Field2.AlternateField.Match.IsNotTrue AND Field3.AlternateField.Match.IsNotTrue)
	)
)
AND ((Field2.Match.IsTrue AND Field2.KeepIfTrue.IsTrue) OR (Field2.Match.IsNotTrue AND Field2.KeepIfTrue.IsNotTrue))
(
	(
		Field3.KeepIfTrue.IsTrue AND 
		(Field3.Match.IsTrue OR Field4.AlternateField.Match.IsTrue OR Field1.AlternateField.Match.IsTrue OR Field2.AlternateField.Match.IsTrue)
	) OR (
		Field3.KeepIfTrue.IsNotTrue AND
		(Field3.Match.IsNotTrue AND Field4.AlternateField.Match.IsNotTrue AND Field1.AlternateField.Match.IsNotTrue AND Field2.AlternateField.Match.IsNotTrue)
	)
)
AND ((Field4.Match.IsTrue AND Field4.KeepIfTrue.IsTrue) OR (Field4.Match.IsNotTrue AND Field4.KeepIfTrue.IsNotTrue)) 
AND ((Field5.Match.IsTrue AND Field5.KeepIfTrue.IsTrue) OR (Field5.Match.IsNotTrue AND Field5.KeepIfTrue.IsNotTrue)) 
AND ((Field6.Match.IsTrue AND Field6.KeepIfTrue.IsTrue) OR (Field6.Match.IsNotTrue AND Field6.KeepIfTrue.IsNotTrue))
AND ((Field7.Match.IsTrue AND Field7.KeepIfTrue.IsTrue) OR (Field7.Match.IsNotTrue AND Field7.KeepIfTrue.IsNotTrue))
ο»Ώ

IMPORTANT: If you have alternative fields for a match and the KeepIfTrue = true, then the match will be true if ANY (at least one) of the evaluations of the main OR the alternative fields is true.

IMPORTANT: If you have alternative fields for a match and the KeepIfTrue = false, then the match will be true if ALL of the evaluations of the main AND the alternative fields are false.

ο»Ώ

Updated 31 Aug 2023
Did this page help you?
PREVIOUS
List IndexOf
NEXT
List filter simple
Docs powered byΒ Archbee
TABLE OF CONTENTS
Scenario
How toο»Ώο»Ώ
List filter Explainedο»Ώο»Ώ
Docs powered byΒ Archbee