title: How do I grab a nested value in json?
body: <p>I've read numerous &quot;grabbing values from nested values in json api&quot;-esque questions and tried to implement them but my code just doesn't seem to work. i'm getting the usual &quot;keyerror:&quot; type errors. This specific code outputs &quot;IndexError: list index out of range&quot;. I am trying to set the value of a variable called &quot;currentUser&quot; to &quot;bob.joe&quot; from value &quot;field_52&quot;</p>
  <pre><code>response = requests.request(&quot;POST&quot;, url, headers=headers)
          responseData = response.json()
          objectsTotal = responseData['objects']
          print(response.text)
          currentUser = responseDat['objects'][6]['data'][1]['field_52']
          print(currentUser)
  </code></pre>
  <p>Here is the json I am trying to parse (only relevant info since sensitive data is in full json)</p>
  <pre><code>{
     &quot;totals&quot;:{
        &quot;objects&quot;:1234,
        &quot;group_totals&quot;:0,
        &quot;offset&quot;:0,
        &quot;limit&quot;:1
     },
     &quot;entity_actions&quot;:{
        
     },
     &quot;listing_fields&quot;:[
        &quot;field_1&quot;,
        &quot;field_5&quot;,
        &quot;field_6&quot;
     ],
     &quot;not_viewable&quot;:1234,
     &quot;objects&quot;:[
        {
           &quot;id&quot;:&quot;censored&quot;,
           &quot;display_name&quot;:&quot;bob.joe&quot;,
           &quot;action_objects&quot;:[
              {
                 
              }
           ],
           &quot;secondary_name&quot;:&quot;Bob Joe&quot;,
           &quot;display_with_secondary&quot;:&quot;Bob.Joe \u003cBob Joe\u003e&quot;,
           &quot;field_values&quot;:[
              &quot;Bob Joe&quot;,
              &quot;Inactive&quot;
           ],
           &quot;data&quot;:{
              &quot;field_52&quot;:&quot;Bob.Joe&quot;,
              &quot;field_1&quot;:&quot;Bob Joe&quot;,
  </code></pre>