title: How to read fields without numeric index in JSON
body: <p>I have a json file where I need to read it in a structured way to insert in a database each value in its respective column, but in the tag <code>&quot;customFields&quot;</code> the fields change index, example: <code>&quot;Tribe / Customer&quot;</code> can be index 0 <code>(row['customFields'][0])</code> in a json block, and in the other one be index 3 <code>(row['customFields'][3])</code>, so I tried to read the data using the name of the row field <code>['customFields'] ['Tribe / Customer']</code>, but I got the error below:</p>
  <blockquote>
  <p>TypeError: list indices must be integers or slices, not str</p>
  </blockquote>
  <p><strong>Script:</strong></p>
  <pre><code>def getCustomField(ModelData):
  
      for row in ModelData[&quot;data&quot;][&quot;squads&quot;][0][&quot;cards&quot;]:
  
          print(row['identifier'],
                row['customFields']['Tribe / Customer'],
                row['customFields']['Stopped with'],
                row['customFields']['Sub-Activity'],
                row['customFields']['Activity'],
                row['customFields']['Complexity'],
                row['customFields']['Effort'])
              
      
  if __name__ == &quot;__main__&quot;:
      f = open('test.json')
      json_file = json.load(f)
      getCustomField(json_file)
  </code></pre>
  <p><strong>JSON:</strong></p>
  <pre><code>{
      &quot;data&quot;: {
          &quot;squads&quot;: [
              {
                  &quot;name&quot;: &quot;TESTE&quot;,
                  &quot;cards&quot;: [
                      {
                          &quot;identifier&quot;: &quot;0102&quot;,
                          &quot;title&quot;: &quot;TESTE&quot;,
                          &quot;description&quot;: &quot; TESTE &quot;,
                          &quot;status&quot;: &quot;on_track&quot;,
                          &quot;priority&quot;: null,
                          &quot;assignees&quot;: [
                              {
                                  &quot;fullname&quot;: &quot;TESTE&quot;,
                                  &quot;email&quot;: &quot;TESTE&quot;
                              }
                          ],
                          &quot;createdAt&quot;: &quot;2020-04-16T15:00:31-03:00&quot;,
                          &quot;secondaryLabel&quot;: null,
                          &quot;primaryLabels&quot;: [
                              &quot;TESTE&quot;,
                              &quot;TESTE&quot;
                          ],
                          &quot;swimlane&quot;: &quot;TESTE&quot;,
                          &quot;workstate&quot;: &quot;Active&quot;,
                          &quot;customFields&quot;: [
                              {
                                  &quot;name&quot;: &quot;Tribe / Customer&quot;,
                                  &quot;value&quot;: &quot;TESTE 1&quot;
                              },
                              {
                                  &quot;name&quot;: &quot;Checkpoint&quot;,
                                  &quot;value&quot;: &quot;GNN&quot;
                              },
                              {
                                  &quot;name&quot;: &quot;Stopped with&quot;,
                                  &quot;value&quot;: null
                              },
                              {
                                  &quot;name&quot;: &quot;Sub-Activity&quot;,
                                  &quot;value&quot;: &quot;DEPLOY&quot;
                              },
                              {
                                  &quot;name&quot;: &quot;Activity&quot;,
                                  &quot;value&quot;: &quot;TOOL&quot;
                              },
                              {
                                  &quot;name&quot;: &quot;Complexity&quot;,
                                  &quot;value&quot;: &quot;HIGH&quot;
                              },
                              {
                                  &quot;name&quot;: &quot;Effort&quot;,
                                  &quot;value&quot;: &quot;20&quot;
                              }
                          ]
                      },
                      {
                          &quot;identifier&quot;: &quot;0103&quot;,
                          &quot;title&quot;: &quot;TESTE&quot;,
                          &quot;description&quot;: &quot; TESTE &quot;,
                          &quot;status&quot;: &quot;on_track&quot;,
                          &quot;priority&quot;: null,
                          &quot;assignees&quot;: [
                              {
                                  &quot;fullname&quot;: &quot;TESTE&quot;,
                                  &quot;email&quot;: &quot;TESTE&quot;
                              }
                          ],
                          &quot;createdAt&quot;: &quot;2020-04-16T15:00:31-03:00&quot;,
                          &quot;secondaryLabel&quot;: null,
                          &quot;primaryLabels&quot;: [
                              &quot;TESTE&quot;,
                              &quot;TESTE&quot;
                          ],
                          &quot;swimlane&quot;: &quot;TESTE&quot;,
                          &quot;workstate&quot;: &quot;Active&quot;,
                          &quot;customFields&quot;: [
                              {
                                  &quot;name&quot;: &quot;Tribe / Customer&quot;,
                                  &quot;value&quot;: &quot;TESTE 1&quot;
                              },
                              {
                                  &quot;name&quot;: &quot;Stopped with&quot;,
                                  &quot;value&quot;: null
                              },
                              {
                                  &quot;name&quot;: &quot;Checkpoint&quot;,
                                  &quot;value&quot;: &quot;GNN&quot;
                              },
                              {
                                  &quot;name&quot;: &quot;Sub-Activity&quot;,
                                  &quot;value&quot;: &quot;DEPLOY&quot;
                              },
                              {
                                  &quot;name&quot;: &quot;Activity&quot;,
                                  &quot;value&quot;: &quot;TOOL&quot;
                              },
                              {
                                  &quot;name&quot;: &quot;Complexity&quot;,
                                  &quot;value&quot;: &quot;HIGH&quot;
                              },
                              {
                                  &quot;name&quot;: &quot;Effort&quot;,
                                  &quot;value&quot;: &quot;20&quot;
                              }
                          ]
                      }
                  ]
              }
          ]
      }
  }
  </code></pre>