title: Anki - Where are the field names?
body: <p>I have a field name. I have a model id. I have a list of fields in a note. I would like to index this list of fields by the field name (<code>"Front"</code>) instead of the index (<code>0</code>) because that is more user-friendly.</p>
  
  <p>How can I get a list of the field names for a given model?</p>
  
  <h3>MCVE</h3>
  
  <pre><code>from aqt import mw
  from anki.utils import splitFields
  
  field_name = "Front"
  model_id = 256
  
  index = unknown_function(model_id, field_name)  # 0
  
  splitFields(
      mw.col.db.scalar("select flds from notes where mid = ?",
                       model_id))[index]
  </code></pre>