How do you remove all joins on a layer programmatically using the ArcGIS Pro SDK?

09-20-2019 07:58 AM
Occasional Contributor II

I know that you can probably do it using the GP tools, but you need to know the join name.

How can you do it without knowing anything about the layer and just insure that you don't have any joins on it?


Tags (1)
0 Kudos
1 Reply
Esri Regular Contributor

Hi Pascal,

From a FeatureLayer you can get a FeatureClass.  

FeatureClass has a method on it called IsJoinedTable.  If this method returns true, the feature class is the actual join.    At that point, calling FeatureClass.GetName() will return the name of the join.

Unfortunately, there is no Pro SDK routine to remove the join from the layer, but now that you know the name of the join you can use geoprocessing in order to do so.

I hope this helps,


0 Kudos