ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / Map Class / FindStandaloneTables Method
The name of the StandaloneTable(s)
Example

In This Topic
    FindStandaloneTables Method (Map)
    In This Topic
    Finds StandaloneTables by name. Group layers within the map are also searched.
    Syntax
    public IReadOnlyList<StandaloneTable> FindStandaloneTables( 
       string name
    )
    Public Function FindStandaloneTables( _
       ByVal name As String _
    ) As IReadOnlyList(Of StandaloneTable)

    Parameters

    name
    The name of the StandaloneTable(s)

    Return Value

    A IReadOnlyList of StandaloneTables with the matching name
    Remarks
    A name is not necessarily unique. More than one StandaloneTable can have the same name. To retrieve StandaloneTables from only the map container and not include StandaloneTables within group layers (within the map), use StandaloneTables
    Example
    Find edit template by name on a layer
    ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() =>
    {
      //get the templates
      var map = ArcGIS.Desktop.Mapping.MapView.Active.Map;
      if (map == null)
        return;
    
      var mainTemplate = map.FindLayers("main").FirstOrDefault()?.GetTemplate("Distribution");
      var mhTemplate = map.FindLayers("Manhole").FirstOrDefault()?.GetTemplate("Active");
    });
    Find table templates belonging to a standalone table
    ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() =>
    {
      var map = ArcGIS.Desktop.Mapping.MapView.Active.Map;
      if (map == null)
        return;
      //Get a particular table template
      var tableTemplate = map.FindStandaloneTables("Address Points").FirstOrDefault()?.GetTemplate("Residences");
      //Get all the templates of a standalone table
      var ownersTableTemplates = map.FindStandaloneTables("Owners").FirstOrDefault()?.GetTemplates();
      var statisticsTableTemplates = MapView.Active.Map.GetStandaloneTablesAsFlattenedList().First(l => l.Name.Equals("Trading Statistics")).GetTemplates();
    });
    Find a standalone table
    // these routines find a standalone table whether it is a child of the Map or a GroupLayer
    var tblFind = aMap.FindStandaloneTable("CIMPATH=map/address_audit.xml");
    
    IReadOnlyList<StandaloneTable> tables = aMap.FindStandaloneTables("addresses");
    
    // this method finds a standalone table as a child of the map only
    var table = aMap.StandaloneTables.FirstOrDefault(t => t.Name == "Addresses");
    Retrieve a table from its container
    var container = MapView.Active.Map;
    
    //the map standalone table collection
    var table = container.GetStandaloneTablesAsFlattenedList()
                            .FirstOrDefault(tbl => tbl.Name == "EarthquakeDamage");
    
    //or from a group layer
    var grp_layer = MapView.Active.Map.FindLayers("GroupLayer1").First() as GroupLayer;
    var table2 = grp_layer.FindStandaloneTables("EarthquakeDamage").First();
    //or         grp_layer.GetStandaloneTablesAsFlattenedList().First()
    //or         grp_layer.StandaloneTables.Where(...).First(), etc.
    
    //show the table in a table view 
    //use FrameworkApplication.Current.Dispatcher.BeginInvoke if not on the UI thread
    FrameworkApplication.Panes.OpenTablePane(table2);
    
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also