ArcGIS Pro 2.9 API Reference Guide
GetTemplate(MapMember,String) Method
Example 

ArcGIS.Desktop.Mapping Namespace > MappingExtensions Class > GetTemplate Method : GetTemplate(MapMember,String) Method
the map member containing the template.
the name of the template to be retrieved.
Gets a template by name for a map member. This method must be called on the MCT. Use QueuedTask.Run.
Syntax
public static EditingTemplate GetTemplate( 
   MapMember member,
   string name
)
Public Overloads Shared Function GetTemplate( _
   ByVal member As MapMember, _
   ByVal name As String _
) As EditingTemplate

Parameters

member
the map member containing the template.
name
the name of the template to be retrieved.

Return Value

the template. Null if the template doesn't exist on the layer.
Exceptions
ExceptionDescription
This method or property must be called within the lambda passed to QueuedTask.Run.
Example
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();
});
Requirements

Target Platforms: Windows 11, Windows 10, Windows 8.1

See Also

Reference

MappingExtensions Class
MappingExtensions Members
Overload List