I have:
- a parent line-layer 'MyParentLineLayer' (referenced layer) with a field
"parent_uuid"
(referenced field). - a child geometryless-layer 'MyChildLayer' (referencing layer) with a field
"parent_uuid_ref"
(referencing field).
I set up a relation between parent layer and child-layer as described before in project properties.
In parent-layer-properties - myRelation the checkbox "Force hide form on add feature" is checked.
I would like to get the line length of the parent-feature as a (editable) default-value in the child-features-form.
I tried:
length(
geometry(
get_feature('MyParentLineLayer', 'parent_uuid', current_value('parent_uuid_ref'))
)
)
as default-value-expression (widget type: text-editor, field type: double) but always got a NULL
-value as line-length.
What is wrong with my code/settings?
current value
function, is a custom function? I think it's justlength(geometry(get_feature('MyParentLineLayer', 'parent_uuid', "parent_uuid_ref")))
remember to put double quotes inparent_uuid_ref
to get the current value of the field and not a constant string.