{ "name": "get_feature", "type": "function", "groups": ["Record and Attributes"], "description": "Returns the first feature of a layer matching a given attribute value.", "variants": [ { "variant": "Single value variant", "variant_description": "Along with the layer ID, a single column and value are specified.", "arguments": [ {"arg":"layer","description":"layer name or ID"}, {"arg":"attribute","description":"attribute name to use for the match"}, {"arg":"value","description":"attribute value to match"}], "examples": [ { "expression":"get_feature('streets','name','main st')", "returns":"first feature found in \"streets\" layer with \"main st\" value in the \"name\" field"} ] }, { "variant": "Map variant", "variant_description": "Along with the layer ID, a map containing the columns (key) and their respective value to be used.", "arguments": [ {"arg":"layer","description":"layer name or ID"}, {"arg":"map","description":"Map containing the column and value pairs to use"}], "examples": [ { "expression":"get_feature('streets',map('name','main st','lane_num','4'))", "returns":"first feature found in \"streets\" layer with \"main st\" value in the \"name\" field and \"4\" value in the \"lane_num\" field"} ] } ] }