get fields using forloop