<?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 JavaScript API esriRequest applyEdits to portal feature table in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/javascript-api-esrirequest-applyedits-to-portal/m-p/411769#M37920</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm sending an esriRequest to a feature table&amp;nbsp;hosted on our portal to add new features via POST method&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I use "esriConfig.request.maxUrlLength = 1; " which forces the request to use POST.&amp;nbsp; now the request goes through but &lt;STRONG&gt;nothing is posted.&lt;/STRONG&gt;..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;esriConfig.portalUrl = "&amp;lt;portalURL&amp;gt;";&lt;/P&gt;&lt;P&gt;esriConfig.request.maxUrlLength = 1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;setTimeout(function(){&lt;BR /&gt; on(dom.byId("submitrecord"), "click", function(){&lt;BR /&gt; esriRequest('&amp;lt;featuretableURL&amp;gt;/applyEdits',{&lt;BR /&gt; query: {&lt;BR /&gt; method: 'POST',&lt;BR /&gt; adds: [&lt;BR /&gt; {&lt;BR /&gt; "attributes": {&lt;BR /&gt; "Notes": "code test",&lt;BR /&gt; "roomID": 1234&lt;BR /&gt; }&lt;BR /&gt; }&lt;BR /&gt; ],&lt;BR /&gt;f:"json"&lt;BR /&gt; },&lt;BR /&gt; }).then(function(r){&lt;BR /&gt; console.log(r);&lt;BR /&gt;});&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; });&lt;BR /&gt;},5000);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using JavaScript api 4.4. and applyedits for feature layer seems not working for tables. so I'm using the esriRequest&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also tried to directly send the request in the browser at&amp;nbsp;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;&amp;lt;featuretableURL&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;/applyEdits'. I copied the request body&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;[&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"attributes": {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"Notes": "code test",&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"roomID": 1234&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;to the "adds" box and it successfully added the feature.&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;Any help is appreciated!&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 19 Sep 2017 15:50:17 GMT</pubDate>
    <dc:creator>ShirleyLi</dc:creator>
    <dc:date>2017-09-19T15:50:17Z</dc:date>
    <item>
      <title>JavaScript API esriRequest applyEdits to portal feature table</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/javascript-api-esrirequest-applyedits-to-portal/m-p/411769#M37920</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm sending an esriRequest to a feature table&amp;nbsp;hosted on our portal to add new features via POST method&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I use "esriConfig.request.maxUrlLength = 1; " which forces the request to use POST.&amp;nbsp; now the request goes through but &lt;STRONG&gt;nothing is posted.&lt;/STRONG&gt;..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;esriConfig.portalUrl = "&amp;lt;portalURL&amp;gt;";&lt;/P&gt;&lt;P&gt;esriConfig.request.maxUrlLength = 1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;setTimeout(function(){&lt;BR /&gt; on(dom.byId("submitrecord"), "click", function(){&lt;BR /&gt; esriRequest('&amp;lt;featuretableURL&amp;gt;/applyEdits',{&lt;BR /&gt; query: {&lt;BR /&gt; method: 'POST',&lt;BR /&gt; adds: [&lt;BR /&gt; {&lt;BR /&gt; "attributes": {&lt;BR /&gt; "Notes": "code test",&lt;BR /&gt; "roomID": 1234&lt;BR /&gt; }&lt;BR /&gt; }&lt;BR /&gt; ],&lt;BR /&gt;f:"json"&lt;BR /&gt; },&lt;BR /&gt; }).then(function(r){&lt;BR /&gt; console.log(r);&lt;BR /&gt;});&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; });&lt;BR /&gt;},5000);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using JavaScript api 4.4. and applyedits for feature layer seems not working for tables. so I'm using the esriRequest&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also tried to directly send the request in the browser at&amp;nbsp;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;&amp;lt;featuretableURL&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;/applyEdits'. I copied the request body&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;[&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"attributes": {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"Notes": "code test",&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"roomID": 1234&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;to the "adds" box and it successfully added the feature.&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;Any help is appreciated!&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Sep 2017 15:50:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/javascript-api-esrirequest-applyedits-to-portal/m-p/411769#M37920</guid>
      <dc:creator>ShirleyLi</dc:creator>
      <dc:date>2017-09-19T15:50:17Z</dc:date>
    </item>
    <item>
      <title>Re: JavaScript API esriRequest applyEdits to portal feature table</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/javascript-api-esrirequest-applyedits-to-portal/m-p/411770#M37921</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm doing something similar because I'm working with 'flat' tables and not 'feature layers' as well.&amp;nbsp; I also ran into an issue like this but eventually resolved it (after making sure it was using POST) by using&amp;nbsp;JSON.stringify() on my data.&amp;nbsp; An example using your code would be something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;adds: JSON.stringify([{ attributes: { "Notes": "code test", "roomID": 1234 }}]),&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not sure if this will help you but might be worth a try.&amp;nbsp; And I did get the&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;esriRequest('&amp;lt;featuretableURL&amp;gt;/applyEdits'... call working for all adds, updates and deletes on tables.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Good luck!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Oct 2017 14:28:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/javascript-api-esrirequest-applyedits-to-portal/m-p/411770#M37921</guid>
      <dc:creator>deleted-user-01arXz5EpgFA</dc:creator>
      <dc:date>2017-10-06T14:28:06Z</dc:date>
    </item>
  </channel>
</rss>

