list_find

Finds an array element by attribute value.

Example

1
{{ products | list_find: "id", "P002" }} => $element

Input

Type Parameter Description Required
array array The array to search. Comes before the | sign. Required
string attribute The attribute to search by  
mixed lookupValue The value to search for  
mixed returnAttribute Attribute to return. Leave empty to return entire element  

Output

Type Description
mixed The found element or null if not found