You can use current_value('field_name')
to access the unsaved value of field_name
in the current form. In this case, it's the node id.
Adapt the following expression in your splice layer Value Relation widget under Filter Expression for both Cable A and Cable B fields:
intersects($geometry,
buffer(geometry(get_feature('node_layer','node_id',current_value('node'))),0.5))
Or, if you want the Cable B field to automatically bring up the Cable B value based on the Cable A value, use the above expression for Cable A, and the following one for Cable B - preferably make it read only if you want to avoid accidentally changing it.
"cable_a_id" = current_value('cable_a')
Demonstration of using the first expression for Cable A and second expression for Cable B.
Widget settings in splice layer for Cable A field
Widget settings in splice layer for Cable B field
Keep the "old" field with the old observers, then create a new field with value relation that you use for new oberservs: those you take with value relation from the table. So you have a clean dataset and don't have to mix old and new observers with the risk of altering data.
You can define a constraint in the "new" field so that if the "old" field already contains a name, it should stay empty.
To combine both old and new observer values, create a 3rd field as virtual filed that dynamically updates and that combines both fields, like:
if (length ("name_old") > 0, "name_old", represent_value ("name_new"))
This field is what you're looking for as it combines bot manually entered values as well as the names from the value relation.
Best Answer
Create a new virtual field with this expression and replace
fieldname
with the name of the Value relation field: