find-value-in-list
Last updated
Last updated
find-value-in-list
adaptor finds a value in a list that matches the search pattern.
The output returns the value of the first match in the list and its index number. To filter a list based on a search pattern use .
list
Type: list
Required: Yes
The list to be searched.
pattern
Type: text
Required: Yes
A text or a regular expression to be searched for within the list.
case sensitive
Type: boolean
Required: No
When set to False
, lowercase and uppercase letters are treated as equivalent when matching values, e.g. Peru
= peru
. If unspecified, defaults to False
.
match diacritics
Type: boolean
Required: No
When set to False
, letters with and without diacritics are treated as equivalent when matching values, e.g. Perú
= Peru
. If unspecified, defaults to False
.
value
Type: text
The value of the first match in the list.
index
Type: number
The one-based index of first match in the list.
list:
United Kingdom
India
Perú
Turkey
United States
pattern:
United
case sensitive:
null (empty)
match diacritics:
null (empty)
value
: United Kingdom
index
: 1
-> Found the value United Kingdom
in the list with the index 1
list:
"Perú"
"Peru"
"peru"
"perú"
pattern:
perú
case sensitive:
True
match diacritics:
True
value
: perú
index
: 4
-> Found the value perú
in the list with the index 4. Since both case sensitive
and match diatrics
were set to True
, the adaptor looked for the exact pattern.
list:
"Perú"
"Peru"
"peru"
"perú"
pattern:
perú
case sensitive:
False
match diacritics:
False
value
: Perú
index
: 1
-> Found the value Perú
in the list with the index 1. Since both case sensitive
and match diatrics
were set to False
, the adaptor returned the first value that was similar to perú
.