<?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 applyEdits with attachments - uploadId error in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/applyedits-with-attachments-uploadid-error/m-p/1447493#M84557</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have created my applyEdits() method. Its logic &lt;SPAN&gt;aligns with the following:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;featureForSend.setAttribute("globalid", "{3b0931f2-78f6-4799-ae0f-13d26c787775}");
EditLayer.applyEdits({
  addFeatures: [featureForSend], 
  addAttachments: [{
     feature: featureForSend,
     attachment: {
        globalId: "{b99a53f2-3b76-4024-97d2-8ceca8b624ae}",
        data: input.files[0]
     }
   }]
}, {gdbVersion: "", 
    returnEditMoment: false, 
    globalIdUsed: true, 
    rollbackOnFailureEnabled: false
}).then((result) =&amp;gt; {...&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;This code fires HTTP request with this data:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;Adds:
[{"geometry":{"spatialReference":{"latestWkid":5514,"wkid":102067},"x":-8988283.904533692,"y":4133042.200104993},"attributes":{"poznamka": "test", "globalid":"{3b0931f2-78f6-4799-ae0f-13d26c787775}"}}]

Attachments:
{"adds":[{"globalId":"{b99a53f2-3b76-4024-97d2-8ceca8b624ae}","parentGlobalId":"{3b0931f2-78f6-4799-ae0f-13d26c787775}","contentType":"image/png","name":"Image 001.png","uploadId":null,"data":"loremipsum"}],"updates":[],"deletes":[]}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;... and it ends with server error "Unable to complete operation. Unable to perform applyEdits operation. An error occurred."&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I’ve discovered an issue related to the&lt;/SPAN&gt; &lt;STRONG&gt;"uploadId":null&amp;nbsp;&lt;/STRONG&gt;parameter (in Attachments data). When I remove this parametr and re-run this request again (directly in REST API), &lt;SPAN&gt;the request succeeds&lt;/SPAN&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;However I'm not able to &lt;SPAN&gt;achieve&lt;/SPAN&gt; &lt;SPAN&gt;the same result using the&lt;/SPAN&gt; ArcGIS Maps SDK fo JavaScript. JS API always adds this &lt;STRONG&gt;"uploadId":null &lt;/STRONG&gt;param to the HTTP request.&lt;/P&gt;&lt;P data-unlink="true"&gt;Is there a solution for this?&amp;nbsp; We have federated Enterprise 10.9.1 and JS API 4.27.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Sun, 12 May 2024 09:08:16 GMT</pubDate>
    <dc:creator>KamilNovák</dc:creator>
    <dc:date>2024-05-12T09:08:16Z</dc:date>
    <item>
      <title>applyEdits with attachments - uploadId error</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/applyedits-with-attachments-uploadid-error/m-p/1447493#M84557</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have created my applyEdits() method. Its logic &lt;SPAN&gt;aligns with the following:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;featureForSend.setAttribute("globalid", "{3b0931f2-78f6-4799-ae0f-13d26c787775}");
EditLayer.applyEdits({
  addFeatures: [featureForSend], 
  addAttachments: [{
     feature: featureForSend,
     attachment: {
        globalId: "{b99a53f2-3b76-4024-97d2-8ceca8b624ae}",
        data: input.files[0]
     }
   }]
}, {gdbVersion: "", 
    returnEditMoment: false, 
    globalIdUsed: true, 
    rollbackOnFailureEnabled: false
}).then((result) =&amp;gt; {...&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;This code fires HTTP request with this data:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;Adds:
[{"geometry":{"spatialReference":{"latestWkid":5514,"wkid":102067},"x":-8988283.904533692,"y":4133042.200104993},"attributes":{"poznamka": "test", "globalid":"{3b0931f2-78f6-4799-ae0f-13d26c787775}"}}]

Attachments:
{"adds":[{"globalId":"{b99a53f2-3b76-4024-97d2-8ceca8b624ae}","parentGlobalId":"{3b0931f2-78f6-4799-ae0f-13d26c787775}","contentType":"image/png","name":"Image 001.png","uploadId":null,"data":"loremipsum"}],"updates":[],"deletes":[]}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;... and it ends with server error "Unable to complete operation. Unable to perform applyEdits operation. An error occurred."&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I’ve discovered an issue related to the&lt;/SPAN&gt; &lt;STRONG&gt;"uploadId":null&amp;nbsp;&lt;/STRONG&gt;parameter (in Attachments data). When I remove this parametr and re-run this request again (directly in REST API), &lt;SPAN&gt;the request succeeds&lt;/SPAN&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;However I'm not able to &lt;SPAN&gt;achieve&lt;/SPAN&gt; &lt;SPAN&gt;the same result using the&lt;/SPAN&gt; ArcGIS Maps SDK fo JavaScript. JS API always adds this &lt;STRONG&gt;"uploadId":null &lt;/STRONG&gt;param to the HTTP request.&lt;/P&gt;&lt;P data-unlink="true"&gt;Is there a solution for this?&amp;nbsp; We have federated Enterprise 10.9.1 and JS API 4.27.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Sun, 12 May 2024 09:08:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/applyedits-with-attachments-uploadid-error/m-p/1447493#M84557</guid>
      <dc:creator>KamilNovák</dc:creator>
      <dc:date>2024-05-12T09:08:16Z</dc:date>
    </item>
  </channel>
</rss>

