I want some alternate to this code as this code just labels only the current feature in the loop .
FEATURES = point_layer3.selectedFeatures()
for f in FEATURES:
total = f['parkeer_approx']
alloted = parking_capacity[f.id()-int(1)]
print(str(f['identificatie']), alloted['parking_id'])
layer = point_layer3
layer.setCustomProperty("labeling", "pal")
layer.setCustomProperty("labeling/enabled", "true")
layer.setCustomProperty("labeling/fontFamily", "Arial")
layer.setCustomProperty("labeling/fontSize", "10")
layer.setCustomProperty("labeling/isExpression", "true")
layer.setCustomProperty("labeling/fieldName", 'CASE WHEN "identificatie" = \'{}\' THEN "parkeer_approx" ELSE '' END'.format(str(f['identificatie'])))
layer.setCustomProperty("labeling/textColorG",255)
layer.setCustomProperty("labeling/placement", "2")
iface.mapCanvas().refresh()
What I wanted to do is that I want to label all the features if they satisfies the CASE. Suppose there are 8 features selected in the layer so i wanted to label only those 8 features one by one if they satisfies the CASE.