<?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 Add and Updates not working for attributes in ArcGIS Runtime for .Net in Developers Questions</title>
    <link>https://community.esri.com/t5/developers-questions/add-and-updates-not-working-for-attributes-in/m-p/689575#M4731</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Environment: &lt;/P&gt;&lt;UL&gt;&lt;LI&gt;ArcGIS Runtime for .NET 10.2.7&lt;/LI&gt;&lt;LI&gt;ArcGIS Server 10.3.1&lt;/LI&gt;&lt;LI&gt;Map Service with Feature Access enabled (Create, Read, Update)&lt;/LI&gt;&lt;LI&gt;Postgres database underneath the map service&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN&gt;ServiceFeatureTable reportLayer = await ServiceFeatureTable.OpenAsync(new Uri("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Flocalhost%2Farcgis%2Frest%2Fservices%2FMyMapService%2FFeatureServer%2F4" target="_blank"&gt;http://localhost/arcgis/rest/services/MyMapService/FeatureServer/4&lt;/A&gt;&lt;SPAN&gt;"));&lt;/SPAN&gt;
var testFeature = reportLayer.CreateNew(); //new GeodatabaseFeature(reportLayer.Schema);
testFeature.Attributes["a_commodity_group"] = "fake";
var addedReportOIDs = await reportLayer.AddAsync(testFeature);
var editResult = await reportLayer.ApplyEditsAsync();&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's worth mentioning that the ServiceFeatureTable "reportLayer" here is nonspatial.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've done the ServiceFeatureTable.CreateNew() as well as creating a new GeodatabaseFeature as described in the documents here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/net/desktop/guide/edit-features.htm#ESRI_SECTION1_2A4C0222216A448C9CBAFCD0F75A21F6" rel="nofollow noopener noreferrer" target="_blank"&gt;&lt;SPAN style="color: #0066cc; text-decoration: underline;"&gt;https://developers.arcgis.com/net/desktop/guide/edit-features.htm#ESRI_SECTION1_2A4C0222216A448C9CBAFCD0F75A21F6&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried Adding and Updating features. The "a_commodity_group" attribute is exactly how I see it spelled in the rest endpoint and is a Text/varchar field in the database underneath&lt;/P&gt;&lt;P&gt;I'm seeing none of my attributes come through. (example, the "fake" value that I've put in here)&lt;/P&gt;&lt;P&gt;ArcGIS Server Log (at "Info" level)&lt;/P&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;P&gt;FINE Mar 28, 2016, 8:59:46 PM GraphicFeatureServer::HandleRESTRequest&lt;/P&gt;&lt;H2 id="toc-hId-1766759068"&gt;inputJSON = {"rollbackOnFailure":true,"adds":[{"attributes":{"objectid":-10}}]}&lt;/H2&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Inspecting client traffic from Telerik's Fiddler:&lt;/P&gt;&lt;P&gt;As you can see, the request is totally wrong in that it doesn't have any other attributes going in. &lt;A href="http://i.stack.imgur.com/Pobnx.png" rel="nofollow noopener noreferrer" target="_blank"&gt;&lt;IMG alt="enter image description here" class="jive-image" src="http://i.stack.imgur.com/Pobnx.png" /&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;BUT,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Manually adding features through "ApplyEdits" in the REST endpoint worked.&amp;nbsp; &lt;A href="http://i.stack.imgur.com/FOtWQ.png" rel="nofollow noopener noreferrer" target="_blank"&gt;&lt;IMG alt="enter image description here" class="jive-image" src="http://i.stack.imgur.com/FOtWQ.png" /&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Info from ArcGIS Server logs (the attributes come in correctly here):&lt;/P&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;P&gt;GraphicFeatureServer::HandleRESTRequest ## inputJSON = {"adds":[{"attributes":{"objectid":-10,"a_commodity_group":"fake"}}],"rollbackOnFailure":true}&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I don't see any known issues with this in the ArcGIS Runtime. This is driving me nuts. I can't add features with custom attributes? I think this is a probably a bug, or I'm doing something wrong because the documentation isn't thorough. It'd be nice if the ArcGIS Runtime could support REST operations other than "applyEdits". (Maybe that's for common functionality between ArcGIS Server and ArcGIS Online?) Unfortunately my workaround at this point is going to have to be writing my own thin C# REST client for adding/updating features, but that's why I downloaded the Runtime SDK for .NET in the first place so I could avoid doing that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 05:01:09 GMT</pubDate>
    <dc:creator>CollinTewalt</dc:creator>
    <dc:date>2021-12-12T05:01:09Z</dc:date>
    <item>
      <title>Add and Updates not working for attributes in ArcGIS Runtime for .Net</title>
      <link>https://community.esri.com/t5/developers-questions/add-and-updates-not-working-for-attributes-in/m-p/689575#M4731</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Environment: &lt;/P&gt;&lt;UL&gt;&lt;LI&gt;ArcGIS Runtime for .NET 10.2.7&lt;/LI&gt;&lt;LI&gt;ArcGIS Server 10.3.1&lt;/LI&gt;&lt;LI&gt;Map Service with Feature Access enabled (Create, Read, Update)&lt;/LI&gt;&lt;LI&gt;Postgres database underneath the map service&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN&gt;ServiceFeatureTable reportLayer = await ServiceFeatureTable.OpenAsync(new Uri("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Flocalhost%2Farcgis%2Frest%2Fservices%2FMyMapService%2FFeatureServer%2F4" target="_blank"&gt;http://localhost/arcgis/rest/services/MyMapService/FeatureServer/4&lt;/A&gt;&lt;SPAN&gt;"));&lt;/SPAN&gt;
var testFeature = reportLayer.CreateNew(); //new GeodatabaseFeature(reportLayer.Schema);
testFeature.Attributes["a_commodity_group"] = "fake";
var addedReportOIDs = await reportLayer.AddAsync(testFeature);
var editResult = await reportLayer.ApplyEditsAsync();&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's worth mentioning that the ServiceFeatureTable "reportLayer" here is nonspatial.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've done the ServiceFeatureTable.CreateNew() as well as creating a new GeodatabaseFeature as described in the documents here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/net/desktop/guide/edit-features.htm#ESRI_SECTION1_2A4C0222216A448C9CBAFCD0F75A21F6" rel="nofollow noopener noreferrer" target="_blank"&gt;&lt;SPAN style="color: #0066cc; text-decoration: underline;"&gt;https://developers.arcgis.com/net/desktop/guide/edit-features.htm#ESRI_SECTION1_2A4C0222216A448C9CBAFCD0F75A21F6&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried Adding and Updating features. The "a_commodity_group" attribute is exactly how I see it spelled in the rest endpoint and is a Text/varchar field in the database underneath&lt;/P&gt;&lt;P&gt;I'm seeing none of my attributes come through. (example, the "fake" value that I've put in here)&lt;/P&gt;&lt;P&gt;ArcGIS Server Log (at "Info" level)&lt;/P&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;P&gt;FINE Mar 28, 2016, 8:59:46 PM GraphicFeatureServer::HandleRESTRequest&lt;/P&gt;&lt;H2 id="toc-hId-1766759068"&gt;inputJSON = {"rollbackOnFailure":true,"adds":[{"attributes":{"objectid":-10}}]}&lt;/H2&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Inspecting client traffic from Telerik's Fiddler:&lt;/P&gt;&lt;P&gt;As you can see, the request is totally wrong in that it doesn't have any other attributes going in. &lt;A href="http://i.stack.imgur.com/Pobnx.png" rel="nofollow noopener noreferrer" target="_blank"&gt;&lt;IMG alt="enter image description here" class="jive-image" src="http://i.stack.imgur.com/Pobnx.png" /&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;BUT,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Manually adding features through "ApplyEdits" in the REST endpoint worked.&amp;nbsp; &lt;A href="http://i.stack.imgur.com/FOtWQ.png" rel="nofollow noopener noreferrer" target="_blank"&gt;&lt;IMG alt="enter image description here" class="jive-image" src="http://i.stack.imgur.com/FOtWQ.png" /&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Info from ArcGIS Server logs (the attributes come in correctly here):&lt;/P&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;P&gt;GraphicFeatureServer::HandleRESTRequest ## inputJSON = {"adds":[{"attributes":{"objectid":-10,"a_commodity_group":"fake"}}],"rollbackOnFailure":true}&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I don't see any known issues with this in the ArcGIS Runtime. This is driving me nuts. I can't add features with custom attributes? I think this is a probably a bug, or I'm doing something wrong because the documentation isn't thorough. It'd be nice if the ArcGIS Runtime could support REST operations other than "applyEdits". (Maybe that's for common functionality between ArcGIS Server and ArcGIS Online?) Unfortunately my workaround at this point is going to have to be writing my own thin C# REST client for adding/updating features, but that's why I downloaded the Runtime SDK for .NET in the first place so I could avoid doing that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 05:01:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/add-and-updates-not-working-for-attributes-in/m-p/689575#M4731</guid>
      <dc:creator>CollinTewalt</dc:creator>
      <dc:date>2021-12-12T05:01:09Z</dc:date>
    </item>
  </channel>
</rss>

