I use the following code: for field in self.layer.pendingFields(): if field.name()=='elevation': do this else: do that Although there is an elevation attribute in my layer it does not recognize it does that instead...