Populate PowerApps Dropdown With SP Library Files BUT Filter Out Folder Names

%3CLINGO-SUB%20id%3D%22lingo-sub-861985%22%20slang%3D%22en-US%22%3EPopulate%20PowerApps%20Dropdown%20With%20SP%20Library%20Files%20BUT%20Filter%20Out%20Folder%20Names%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-861985%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20a%20SP%20document%20library%20with%20files%20and%20folders.%20I%20can%20setup%20a%20dropdown%20menu%20in%20PowerApps%20that%20will%20display%20all%20files%20in%20document%20library.%20Unfortunately%20it%20also%20includes%20folder%20names.%20How%20do%20I%20filter%20out%20the%20folder%20names%20so%20only%20file%20names%20will%20appear%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-861985%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EPowerApps%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-863883%22%20slang%3D%22en-US%22%3ERe%3A%20Populate%20PowerApps%20Dropdown%20With%20SP%20Library%20Files%20BUT%20Filter%20Out%20Folder%20Names%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-863883%22%20slang%3D%22en-US%22%3E%3CP%3EAny%20ideas%20will%20be%20greatly%20appreciated.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-867256%22%20slang%3D%22en-US%22%3ERe%3A%20Populate%20PowerApps%20Dropdown%20With%20SP%20Library%20Files%20BUT%20Filter%20Out%20Folder%20Names%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-867256%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F246794%22%20target%3D%22_blank%22%3E%40cgtrman%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20not%20tested%20this%20in%20PowerApps%20(sorry%2C%20I%20don't%20have%20time%20just%20now)%2C%20but%20in%20other%20applications%20(such%20as%20content%20rollup)%20when%20I%20need%20to%20filter%20out%20folder%20names%2C%20I%20apply%20a%20filter%20where%20Content%20Type%20is%20NOT%20Folder.%3C%2FP%3E%3CP%3EAre%20you%20able%20to%20do%20that%20in%20this%20scenario%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESandy%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-867304%22%20slang%3D%22en-US%22%3ERe%3A%20Populate%20PowerApps%20Dropdown%20With%20SP%20Library%20Files%20BUT%20Filter%20Out%20Folder%20Names%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-867304%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F16657%22%20target%3D%22_blank%22%3E%40Sandy%20Ussia%3C%2FA%3E%26nbsp%3B%20Thanks%20for%20the%20response%20Sandy!%26nbsp%3B%20In%20the%20dropdown%20menu's%20%22Items%22%20property%2C%20I%20had%20just%20the%20name%20of%20the%20SPO%20List.%20To%20filter%20out%20folder%20names%20from%20appearing%2C%20I%20used%20the%20following%20code%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFilter('SPO%20LIST%20NAME'%2C%20!IsFolder)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThis%20worked!%20I%20do%20get%20a%20yellow%20warning%20icon%20indicating%20%22Delegation%20warning.%20The%20highlighted%20part%20of%20this%20formula%20might%20not%20work%20correctly%20with%20%22IsFolder%22%20on%20large%20data%20sets.%22%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EOne%20other%20question%20-%20How%20do%20I%20add%20a%20%22Please%20Select%20a%20File%22%20as%20the%20default%20item%20in%20my%20dropdown%20menu%3F%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Contributor

I have a SP document library with files and folders. I can setup a dropdown menu in PowerApps that will display all files in document library. Unfortunately it also includes folder names. How do I filter out the folder names so only file names will appear?

3 Replies

Any ideas will be greatly appreciated. 

Hi @cgtrman 

 

I have not tested this in PowerApps (sorry, I don't have time just now), but in other applications (such as content rollup) when I need to filter out folder names, I apply a filter where Content Type is NOT Folder.

Are you able to do that in this scenario?

 

Sandy

 

@Sandy Ussia  Thanks for the response Sandy!  In the dropdown menu's "Items" property, I had just the name of the SPO List. To filter out folder names from appearing, I used the following code:

 

Filter('SPO LIST NAME', !IsFolder)

 

This worked! I do get a yellow warning icon indicating "Delegation warning. The highlighted part of this formula might not work correctly with "IsFolder" on large data sets."

 

One other question - How do I add a "Please Select a File" as the default item in my dropdown menu?