title: How do I dynamically update a Maps Engine data table with JavaScript?
body: <p>I have a Maps Engine  map with one of the layers linked to a data table containing a single location.  I would like to update the data table via JavaScript in Google Sites. The <a href="http://developers.google.com/apis-explorer/#p/mapsengine/v1/mapsengine.tables.features.batchPatch" rel="nofollow"><code>mapsengine.tables.features.batchPatch</code></a> seems to do what I want, and the help page for the <code>batchInsert</code> version of the same command seems like it could be modified to do what I want.  However, I'm having difficulty getting it to work properly.  I believe the problem is due to the fact that I don't know what the primary key is for this table or where I can find it (see <a href="https://developers.google.com/maps-engine/documentation/feature-update#errors" rel="nofollow">here</a> for more explanation).</p>
  
  <p>Can anyone here tell me if I'm headed in the right direction, and how I might be able to find this primary key (it also seems to be referred to as a <code>gx_id</code> at times)?  Thanks in advance for whatever help you may be able to provide.</p>
  
  <p><strong>Edit:</strong> When I go <a href="http://developers.google.com/apis-explorer/#p/mapsengine/v1/mapsengine.tables.list?_h=1&amp;" rel="nofollow">here</a> and get the information on my table, I get the following response:</p>
  
  <pre><code>{
   "tables": [
    {
     "id": {My Table ID},
     "etag": "\"6030101253664097613\"",
     "projectId": {My Project ID},
     "name": "Current Location",
     "description": "",
     "tags": [
     ],
     "writersCanEditPermissions": false,
     "sourceEncoding": "UTF-8",
     "processingStatus": "complete",
     "bbox": [
      -180,
      -90,
      180,
      90
     ],
     "creationTime": "2014-11-11T21:33:43.982Z",
     "lastModifiedTime": "2014-11-12T20:55:20.613Z"
    }
   ]
  }
  </code></pre>
  
  <p>As you can see, there is no <code>gx_id</code> listed.  Is there some way to add it, or do I need to recreate the table to be able to add it from the start?  If I need to recreate the table, what do I need to do to make sure the <code>gx_id</code> is there, since it wasn't immediately apparent when I created the table last time that anything was missing.</p>