How can I filter a for loop based on the value of a field? How can I filter a for loop based on the value of a field?

I tried filterByValue, but I do not know how to construct the statement.

This is NOT a category field. 

I have this...

{% for line in craft.entries.section('docs').filterByVale('account: 05').all() %}
    &lt;a href="{{ line.url }}"&gt;{{line.lineItemTitle}} ({{line.lineItemTitle}})&lt;/a&gt;, 
{% endfor %}


How do I do this?

Thanks
You don't filter a loop but you can attach certain criteria in your ElementQuery. craft.entries returns you an object of type EntryQuery (link to docs). You can search for specific entries based on different criterias by calling magic methods or function in your Query object.

For example: section('docs') will return only entries in the section docs. You can attach any field handle that is in your field layout as well.. In your case account('05').

{% for line in craft.entries.section('docs').account('05').all() %}
     &lt;a href="{{ line.url }}"&gt;{{line.lineItemTitle}} ({{line.lineItemTitle}})&lt;/a&gt;, 
{% endfor %}


If you want to search for multiple values you can include them as array or comma separated string.

craft.entries
    .section(['section1', 'section2')
    .account('and, &gt;=5, &lt;=10')
    .anotherField('or, 3, 5')
    .someThingElse(['or' ,3 , 5])
    .all()


You can see all available syntax examples in the DB::parseParam() function