I have a need to create a view on a SharePoint list that shows only items with attachments. Any idea how I can achieve this? Through Microsoft flow, I can see a hidden field called "has attachments" which can either be true or false. I have thought of creating a custom field and using a flow that runs on create to store the value of the "has attachments" field. The List basically is an archive list and is not being actively modified by users. I am wondering if there is a better approach to doing this so as to save precious Flow runs.
3 Answers
There's a simple way.
You can create Yes/no column named "HasAttachments" in lists. If list item has attachment, choose Yes, if list item has no attachment, choose No.
Then you can filter the columns and show only “Yes”.
Or you can create a managed property named "HasAttachments" and mapped the crawled property "ows_q_BOOL_Hasattachments".
Add a content search web part, Set query like:
contentclass:"STS_ListItem" AND HasAttachments:1
Microsoft has been adding a lot of features lately. There is now a columns that exists by default called "Attachments" that appears to be boolean. Just filter the list on "Attachments" "is equal to" "Yes".
Edit your view and in Filter condition, select Attachments field, set condition 'is equal to', value to Yes.
If you are using OData
query then you can use following query:
Attachments eq true
In some cases this is not working. Then you can use this query:
Attachments ne false