title: Access to JSON element in groovy map
body: <p>I'm trying to access an element of some json returned into a map from an api call so I can pass it to another api call. I can't seem to properly create a varible and give it the value I need. Here's the returned json, I need to access the Id element.</p>
  
  <pre><code>{
        "totalSize": 1,
        "done": true,
        "records":  [
           {
            "attributes":  {
              "type": "User",
              "url": "/services/data/v24.0/sobjects/User/MYIDNUMBER"
            },
            "Id": "MYIDNUMBER"
          }
        ]
      }
  </code></pre>
  
  <p>here's the restful service call I use and my attempt to access the Id element and put it in sfId so I can use it in my next API call</p>
  
  <pre><code>        def http = new HTTPBuilder(instance_domain)
          http.request(GET,JSON) { req -&gt;
          uri.path = "services/data/v24.0/query/"
          uri.query = [q:"SELECT Id from User WHERE Email = '$loginid@myschool.edu'"]
          headers['Authorization'] = "Bearer $access_token"
              response.success = { resp, json  -&gt;
              json.each{ key,value -&gt;
               sfMap = [sfUser: [json: json]]
                  }
              sfId = sfMap[records.Id]
              }
              response.failure = { resp, json -&gt;
                      println resp.status
                      println json.errorCode
                      println json.message
                  }                   
              }
  </code></pre>
  
  <p>I get the following error on the server where the portletized version of this is deployed</p>
  
  <pre><code>2014-07-08 08:02:39,710 ERROR [http-bio-443-exec-161] portal-web.docroot.html.portal.render_portlet_jsp:154 groovy.lang.MissingPropertyException: No such property: records for class: groovyx.net.http.HTTPBuilder$RequestConfigDelegate
  </code></pre>