Wrong data included in before insert trigger

Solution 1:

I think

= (select electr.id from electr)

should be

= new.id