I used the following snippet with different schemas (I attached my sample ArcGIS Pro project file):
protected override async void OnClick()
{
try
{
var environments = Geoprocessing.MakeEnvironmentArray(overwriteoutput: true);
var toolPath = "management.Append";
var shapefilePath = @"C:\Users\wolf2125\Documents\ArcGIS\Projects\GPTestAppendTool\ShapeFile\base_state.shp";
var shapefileName = System.IO.Path.GetFileNameWithoutExtension(shapefilePath);
var destintationTable = "BaseState";
var fields = new string[] {
$@"AREA ""AREA"" true false false 8 Double 0 0,First,#,{shapefilePath},AREA,-1,-1",
$@"PERIMETER ""PERIMETER"" true false false 8 Double 0 0,First,#,{shapefilePath},PERIMETER,-1,-1",
$@"BASEMAP_ ""BASEMAP_"" true false false 8 Double 0 0,First,#,{shapefilePath},BASEMAP_,-1,-1",
$@"BASEMAP_ID ""BASEMAP_ID"" true false false 8 Double 0 0,First,#,{shapefilePath},BASEMAP_ID,-1,-1",
$@"Test ""TYPE"" true false false 10 Text 0 0,First,#,{shapefileName},TYPE,0,10" };
var fieldMap = string.Join(";", fields);
var Parameters = Geoprocessing.MakeValueArray(shapefileName, destintationTable, "NO_TEST", fieldMap, "", "");
var gpResult = await Geoprocessing.ExecuteToolAsync(toolPath, Parameters, environments);
Geoprocessing.ShowMessageBox(gpResult.Messages, "GP Messages", gpResult.IsFailed ? GPMessageBoxStyle.Error : GPMessageBoxStyle.Default);
}
catch (Exception ex)
{
MessageBox.Show($@"Error: {ex}");
}
}
Actually I just noticed that I had changed the alias name for the "Test" column in the destination table from "Type" to "Test" but I forgot to make the change in the code snippet. However, i seems that the alias name doesn't matter for this tool.