2022-12-30 20:00:23 +07:00
{
"name": "is_feature_valid",
"type": "function",
"groups": ["Record and Attributes"],
"description": "Returns TRUE if a feature meets all field constraints.",
"arguments": [{
"arg": "feature",
2023-01-03 09:10:56 +07:00
"description": "A feature. If not set, the current feature will be used.",
2022-12-30 20:00:23 +07:00
"optional": true
},{
"arg": "layer",
2023-01-03 09:10:56 +07:00
"description": "A vector layer. If not set, the current layer will be used.",
2022-12-30 20:00:23 +07:00
"optional": true
},{
"arg": "strength",
"description": "Set to 'hard' or 'soft' to narrow down to a specific constraint type. If not set, the function will return FALSE if either a hard or a soft constraint fails.",
"optional": true
}],
"examples": [{
"expression": "is_feature_valid(strength:='hard')",
2023-01-03 09:10:56 +07:00
"returns": "TRUE if all fields from the current feature meet their hard constraints."
2022-12-30 20:00:23 +07:00
}, {
"expression": "is_feature_valid(get_feature('my_layer', 'FID', 10), 'my_layer')",
2023-01-03 09:10:56 +07:00
"returns": "FALSE if all fields from feature with \"FID\"=10 in 'my_layer' fails to meet all constraints."
2022-12-30 20:00:23 +07:00
}],
"tags": ["constraints", "hard", "soft"]
}