I joined a table to a layer in QGIS using code from this thread: Joining layers with PyQGIS 3.
Now I would like to remove the join. How can I do it?
Removing table join using PyQGIS
attribute-joinspyqgisremovevector
attribute-joinspyqgisremovevector
I joined a table to a layer in QGIS using code from this thread: Joining layers with PyQGIS 3.
Now I would like to remove the join. How can I do it?
Best Answer
QgsVectorLayer
possesses a method for that:removeJoin(joinLayerId: str)
.So, if
layer2
was initially joined tolayer1
, the code for removing the join may look like this: