<div dir="ltr"><div>Hi Hannes</div><div><br></div><div>This looks like an XY problem case!</div><div><br></div><div>If your actual goal is to:</div><div>> Any pointers on how to properly update a new feature's attribute fields, <br>> that exist on a layer but are not shown the user with the QGIS' widgets <br>> in the attribute form?</div><div><br></div><div>then you simply need to set a Default Value for the field widget but not add it to the drag and drop form designer. :)<br></div><div><br></div><div>If you really want to do this using form init code, you cannot do it using the form's feature object as it is actually copied by QgsAttributeForm before being saved to the layer.</div><div>You could connect to QgsAttributeForm::featureSaved() signal instead, that emits the actual feature, but apparently the my_form_open function is called twice: once when the form is loaded and once after OK is clicked (bug??), so that would create the connection twice!</div><div>To avoid this you could connect to QgsAttributeForm::featureSaved() only after OK is clicked!</div><div><br></div><div>Best</div><div>Stefanos<br></div><br><div><br></div></div>