<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Edit Operation Error in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/edit-operation-error/m-p/1318540#M10179</link>
    <description>&lt;P&gt;I'm not sure why I keep getting this error, "Copy operation failed Edit operation failed. The value type is incompatible with the field type." I checked the value type and field type, and it's the same, both a double value and field type. I'm trying to perform some calculations using the attribute table of a featureClassA, then create a new featureClassB with the output calculations. In the featureClassA, there are numerous of null values in the dataset. I suspect it is related to the null values. What are the common reasons for this error message? I included a shorter version of my script below:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;foreach (var FieldID in FieldIDList)
 {

      //AWC
      Process.AggregateValues(input values here));
}
 WriteAggregateFields(FieldIDList, outGDB);
});

public async void PopulateAggregateValues(input values here)
        {
            var mv = MapView.Active;
            var newLayer = NewLayerName;
            var newLayerPath = outGDB + "\\" + newLayer;
            var dict = new Dictionary&amp;lt;string, object&amp;gt;();
            //var idList = FieldIDList;
            string Field_Low = FieldName + "_Low";
            string Field_Rep = FieldName + "_Rep";
            string Field_High = FieldName + "_High";
            var FinalLyr = mv.Map.GetLayersAsFlattenedList().OfType&amp;lt;FeatureLayer&amp;gt;().Where(fl =&amp;gt; fl.Name.Contains(newLayer)).FirstOrDefault();
            int i = 0;


            await QueuedTask.Run(() =&amp;gt;
            {
                EditOperation edOp = new EditOperation();
                using (var rowCursor = AggregateLayer.Search())
                {
                    while (rowCursor.MoveNext())
                    {

                        using (var row = rowCursor.Current as Feature)
                        {
                            if (LowArea &amp;gt; 0)
                            {
                                dict[Field_Low] = FieldList[i].Item1;

                            }
                            else
                            {
                                dict[Field_Low] = "&amp;lt;Null&amp;gt;";
                            }
                            if (RepArea != double.NaN)
                            {
                                dict[Field_Rep] = FieldList[i].Item2;

                            }
                            else
                            {
                                dict[Field_Rep] = "&amp;lt;Null&amp;gt;";
                            }
                            if (HighArea &amp;gt; 0)
                            {

                                dict[Field_High] = FieldList[i].Item3;

                            }
                            else
                            {
                                dict[Field_High] = "&amp;lt;Null&amp;gt;";
                            }

                            edOp.Modify(FinalLyr, row.GetObjectID(), dict);
                            i++;



                        }
         
                    }
                }
                if (!edOp.Execute())
                {
                    MessageBox.Show($@"Copy operation failed {edOp.ErrorMessage}");
                    return;
                }
            });
        }

           
        }

 private void WriteAggregateFields(List&amp;lt;string&amp;gt; FieldIDList, string outGDB)
        {
            var AggregateLayer = SelectedAggLayer;
            var AggregateField = SelectedField;
            var newLayerPath = outGDB + "featureClassBName";



            //Populate featureClassB fields
            Process.PopulateGeomID(outGDB, "NewLayer", AggregateLayer, 
AggregateField, FieldIDList);

Process.PopulateAggregateValues(outGDB, "NewLayer", AggregateLayer, AggregateField, FieldList, "FieldName", FieldLowArea, FieldRepArea, FieldHighArea);

}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 15 Aug 2023 00:29:56 GMT</pubDate>
    <dc:creator>tzz_12</dc:creator>
    <dc:date>2023-08-15T00:29:56Z</dc:date>
    <item>
      <title>Edit Operation Error</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/edit-operation-error/m-p/1318540#M10179</link>
      <description>&lt;P&gt;I'm not sure why I keep getting this error, "Copy operation failed Edit operation failed. The value type is incompatible with the field type." I checked the value type and field type, and it's the same, both a double value and field type. I'm trying to perform some calculations using the attribute table of a featureClassA, then create a new featureClassB with the output calculations. In the featureClassA, there are numerous of null values in the dataset. I suspect it is related to the null values. What are the common reasons for this error message? I included a shorter version of my script below:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;foreach (var FieldID in FieldIDList)
 {

      //AWC
      Process.AggregateValues(input values here));
}
 WriteAggregateFields(FieldIDList, outGDB);
});

public async void PopulateAggregateValues(input values here)
        {
            var mv = MapView.Active;
            var newLayer = NewLayerName;
            var newLayerPath = outGDB + "\\" + newLayer;
            var dict = new Dictionary&amp;lt;string, object&amp;gt;();
            //var idList = FieldIDList;
            string Field_Low = FieldName + "_Low";
            string Field_Rep = FieldName + "_Rep";
            string Field_High = FieldName + "_High";
            var FinalLyr = mv.Map.GetLayersAsFlattenedList().OfType&amp;lt;FeatureLayer&amp;gt;().Where(fl =&amp;gt; fl.Name.Contains(newLayer)).FirstOrDefault();
            int i = 0;


            await QueuedTask.Run(() =&amp;gt;
            {
                EditOperation edOp = new EditOperation();
                using (var rowCursor = AggregateLayer.Search())
                {
                    while (rowCursor.MoveNext())
                    {

                        using (var row = rowCursor.Current as Feature)
                        {
                            if (LowArea &amp;gt; 0)
                            {
                                dict[Field_Low] = FieldList[i].Item1;

                            }
                            else
                            {
                                dict[Field_Low] = "&amp;lt;Null&amp;gt;";
                            }
                            if (RepArea != double.NaN)
                            {
                                dict[Field_Rep] = FieldList[i].Item2;

                            }
                            else
                            {
                                dict[Field_Rep] = "&amp;lt;Null&amp;gt;";
                            }
                            if (HighArea &amp;gt; 0)
                            {

                                dict[Field_High] = FieldList[i].Item3;

                            }
                            else
                            {
                                dict[Field_High] = "&amp;lt;Null&amp;gt;";
                            }

                            edOp.Modify(FinalLyr, row.GetObjectID(), dict);
                            i++;



                        }
         
                    }
                }
                if (!edOp.Execute())
                {
                    MessageBox.Show($@"Copy operation failed {edOp.ErrorMessage}");
                    return;
                }
            });
        }

           
        }

 private void WriteAggregateFields(List&amp;lt;string&amp;gt; FieldIDList, string outGDB)
        {
            var AggregateLayer = SelectedAggLayer;
            var AggregateField = SelectedField;
            var newLayerPath = outGDB + "featureClassBName";



            //Populate featureClassB fields
            Process.PopulateGeomID(outGDB, "NewLayer", AggregateLayer, 
AggregateField, FieldIDList);

Process.PopulateAggregateValues(outGDB, "NewLayer", AggregateLayer, AggregateField, FieldList, "FieldName", FieldLowArea, FieldRepArea, FieldHighArea);

}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Aug 2023 00:29:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/edit-operation-error/m-p/1318540#M10179</guid>
      <dc:creator>tzz_12</dc:creator>
      <dc:date>2023-08-15T00:29:56Z</dc:date>
    </item>
    <item>
      <title>Re: Edit Operation Error</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/edit-operation-error/m-p/1318592#M10181</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Try to change all places where you use&amp;nbsp;"&amp;lt;Null&amp;gt;" to null&lt;/P&gt;</description>
      <pubDate>Tue, 15 Aug 2023 07:36:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/edit-operation-error/m-p/1318592#M10181</guid>
      <dc:creator>GKmieliauskas</dc:creator>
      <dc:date>2023-08-15T07:36:01Z</dc:date>
    </item>
  </channel>
</rss>

