<div dir="ltr"><div dir="ltr">Hi, <div><br></div><div>Hope anyone can help me with this:</div><div><br></div><div>I'm trying to iterate over the fields of a vector layer (using the index) and fill in the values by an expression</div><div><br></div><div><div> my_features = a_layer.getFeatures()</div><div>    for a_feat in my_features:</div><div>        mijn_index = a_feat.fieldNameIndex('perc_nr')</div><div>        value = an_expr</div><div>         a_feat.setAttribute(mijn_index, value)</div><div>    </div><div>    a_layer.commitChanges()</div></div><div><br></div><div>I don't get an error but nothing is filled in. I evaluated the expression and it's true. It also works in the field calculator.</div><div><br></div><div>Anyone an idea?</div><div><br></div><div><br></div><div>Kind regards</div><div>Wouter</div></div></div>