code: def getfieldindex(data, commdct, objkey, fname):
      
      objindex = data.dtls.index(objkey)
      objcomm = commdct[objindex]
      for i_index, item in enumerate(objcomm):
          try:
              if item['field'] == [fname]:
                  break
          except KeyError as err:
              pass
      return i_index
docs: given objkey and fieldname, return its index