I really looked into this issue, and eventually created an Azure account, registered an app etc. But along the way I got stuck because of some authorization issues. However I still read the Graph documentation, here is what I found:
Apparently contains is a function, not an operator. So the correct usage would be contains(fields/Title, 'For') or contains(file/Name, 'For').
n8n gives a default example fields/Title eq 'item1' but eqhere is an operator, so it is different than the contains() function.
try contains(flelds/FileLeafRef, 'For')or fields/FileLeafRef eq '30 - Formations') for specific files.
I also read about FileLeafRef, didn’t mention it here tough, tought past ones would work. These must solve your issue. Keep in mind that eq means equals so you might need to write the exact same name when using it.
It worked actually, just that FileLeafReffield isn’t indexed, so it returns this error. This is how Sharepoint protects slow queries if the list is too big. You have a couple of solutions:
→ Go to Sharepoint Dashboard, Settings, Columns, and add FileLeafRefas indexed column.
→ Use an HTTP Request node instead, and add a header(Prefer) with this value in your request: HonorNonIndexedQueriesWarningMayFailRandomly.
→ You can also send a GET request to this url: https://{tenant}.sharepoint.com/sites/{site}/_api/web/lists/getbytitle('YourList')/fields?$select=Title,InternalName,Indexed,Filterable,Sortable,Queryable to retrieve fields that you can use in your filter.
But, adding the FileLeafRef as indexed column seems easier so I recommend doing so.