I have few folders in list each with around 5000 items. I need the data in excel so when I click on export to excel link in ribbon it gets all the item in list including the folder name also.

SO is there any way that I can exclude the folder names in the excel data.

  • Have you tried adding a view with the option 'Show all items without folders' and a Filter for 'where Content Type is not equal to Folder'? This should work in theory but the number of items (many thousands) may cause issues due to the List Item View Threshold (5000 for SP Online, configurable for on-prem). Jul 19, 2017 at 8:28
  • yes threshold is the problem, i can not get all items in a view
    – KumarV
    Jul 19, 2017 at 8:29

1 Answer 1


If the list view threshold is preventing you from getting all the items in browser view then there is no way round this (other than upping the threshold limit, though not an option in SP Online).

If you install the SharePoint Online Client Side Components you can use these in Powershell with CSOM and CAML to either:

a) issue a CAML query to get all items where Content Type is not equal to 'Folder'

b) issue a CAML query to get all items, then check each one in code to see whether it is a folder

I will post the code for this shortly as I was trying to write it but have hit a problem myself trying to get the ContentType field.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.