filter-list

Description

filter-list adaptor filters values in a list based on a search criteria or regular expression.

Provides two lists as outputs, one containing values that match the search criteria and one containing values that do not match the search criteria.

Inputs

list Type: list Required: Yes The list to be filtered.

filter type Type: text Required: Yes The type of filter applied.

filter value Type: text Required: No A text or a regular expression to be searched for within the datatable columns. When a range is needed, please use this format: number,number

match diacritics Type: boolean Required: No When set to True, letters with and without diacritics are treated as equivalent when matching values, e.g., Perú = Peru. If unspecified, defaults to True.

case sensitive Type: boolean Required: No When set to True, lowercase and uppercase letters are treated as different when comparing text values. When set to False, lowercase and uppercase letters are treated as equivalent. If unspecified, defaults to False

Outputs

values Type: list A list with the values that match the testing pattern.

complementary Type: list A list with the values that do not match the testing pattern.

Examples

Example 1: Default behaviour.

Inputs:

list:

  1. Jan

  2. Feb

  3. Mar

  4. Apr

  5. May

  6. June

filter type: starts-with

filter value: J

match diacritics: null

case sensitive: null

Outputs:

values:

  1. Jan

  2. June

complementary:

  1. Feb

  2. Mar

  3. Apr

  4. May

-> Filtered the list for all the words starting with the letter J

Example 2: Filter list with match diactrics and case sensitive set to true.

Inputs:

list:

  1. "Perú"

  2. "Peru"

  3. "perú"

  4. "peru"

filter type: equals

filter value: peru

match diacritics: True

case sensitive: True

Outputs:

values:

  1. "peru"

complementary:

  1. "Perú"

  2. "Peru"

  3. "perú"

-> Filtered the list for all the words that are equal to peru with case sensitive and match diatrics set to True.

Last updated