SOLVED

Powerapps filter Gallery

%3CLINGO-SUB%20id%3D%22lingo-sub-889111%22%20slang%3D%22en-US%22%3EPowerapps%20filter%20Gallery%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-889111%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20creating%20a%20power%20app%20to%20view%20and%20make%20entries%20in%20a%20sharepoint%20list.%3C%2FP%3E%3CP%3ENow%20I%20created%20a%20new%20Screen%20with%20a%20gallery%20and%20the%20source%20is%20my%20sharepoint%20list.%20In%20the%20list%2C%20there%20is%20a%20field%20that%20is%20called%20%22closed%22%20and%20it%20has%20a%20drop%20down%20menu%20with%20yes%2Fno.%20Now%20I%20want%20this%20particular%20gallery%20to%20only%20show%20the%20lines%20of%20the%20sharepoint%20list%20were%20the%20field%20%22closed%22%20is%20set%20to%20'No'.%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20there%20any%20way%20to%20do%20that%3F%3C%2FP%3E%3CP%3EI%20experimented%20a%20bit%20by%20changing%20the%20following%20line%2C%20but%20nothing%20seems%20to%20work.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20934px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F135129i96AF76786326FE42%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22Capture.JPG%22%20title%3D%22Capture.JPG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EFor%20any%20help%20I%20would%20be%20greatful!%3C%2FP%3E%3CP%3EThanks%3C%2FP%3E%3CP%3EChristina%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-889111%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EPowerApps%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-889497%22%20slang%3D%22en-US%22%3ERe%3A%20Powerapps%20filter%20Gallery%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-889497%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%2F407056%22%20target%3D%22_blank%22%3E%40christina_hoeglinger%3C%2FA%3E%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20can%20use%20the%20%22Filter%22%20command%20in%20the%20%22Items%22%20property%20to%20filter%20the%20list.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHere%20is%20my%20unfiltered%20app%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F135162i076D08D87A4C0BEB%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%221.PNG%22%20title%3D%221.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHere%20is%20my%20filtered%20app%20and%20code%3A%3C%2FP%3E%3CPRE%3ESortByColumns(%3CSTRONG%3EFilter(%5B%40PowerAppsDemo%5D%2C%20Closed%20%3D%20false%3C%2FSTRONG%3E)%2C%20%22Title%22%2C%20If(SortDescending1%2C%20Descending%2C%20Ascending))%3C%2FPRE%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F135164iFFBA4CFC96CCD6B3%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%222.PNG%22%20title%3D%222.PNG%22%20%2F%3E%3C%2FSPAN%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EUnfortunately%2C%20using%20%22%3CSTRONG%3Etrue%3C%2FSTRONG%3E%22%20does%20not%20work%20as%20expected.%20Here%20is%20a%20version%20of%20the%20code%20for%20%22true%22%20but%20be%20warned%20you%20will%20get%20%22Delegation%22%20warnings.%3C%2FP%3E%3CPRE%3ESortByColumns%3CSTRONG%3E(Filter(%5B%40PowerAppsDemo%5D%2C%20Closed%20%26lt%3B%26gt%3B%20false)%3C%2FSTRONG%3E%2C%20%22Title%22%2C%20If(SortDescending1%2C%20Descending%2C%20Ascending))%3C%2FPRE%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F135169iACFB16E604F1DC42%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%223.PNG%22%20title%3D%223.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EI%20hope%20this%20helps.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENorm%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-890350%22%20slang%3D%22en-US%22%3ERe%3A%20Powerapps%20filter%20Gallery%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-890350%22%20slang%3D%22en-US%22%3E%3CP%3EIt%E2%80%99s%20a%20drop%20down%20aka%20choice%20column%20with%20those%20values%20and%20so%20it%E2%80%99s%20a%20delegated%20query%20now%20so%20if%20you%20use%20filter(data%20source%2Cclosed.value%20%3D%20%E2%80%9Cno%E2%80%9D)%20in%20items%20you%20will%20get%20the%20result%20you%20need.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-890884%22%20slang%3D%22en-US%22%3ERe%3A%20Powerapps%20filter%20Gallery%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-890884%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F869%22%20target%3D%22_blank%22%3E%40Chris%20Webb%3C%2FA%3E%26nbsp%3Bthanks%20for%20pointing%20that%20out.%20I%20missed%20it%20in%20the%20original%20post.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F407056%22%20target%3D%22_blank%22%3E%40christina_hoeglinger%3C%2FA%3E%2C%20Chris'%20code%20example%20should%20give%20you%20what%20you%20need.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENorm%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-891375%22%20slang%3D%22en-US%22%3ERe%3A%20Powerapps%20filter%20Gallery%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-891375%22%20slang%3D%22en-US%22%3E%3CP%3EThank%20you%20so%20much!%20I%20actually%20was%20pretty%20close%20to%20this%20solution%2C%20i%20just%20forgot%20the%20.Value%20after%20Closed%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F869%22%20target%3D%22_blank%22%3E%40Chris%20Webb%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20follow-up%20question%20regarding%20your%20post%3A%20when%20you%20say%20delegated%20query%2C%20do%20you%20mean%20that%20the%20job%20gets%20passed%20on%20to%20sharepoint%3F%20I%20think%20I%20read%20about%20this%2C%20but%20I%20am%20not%20sure%20if%20this%20is%20what%20you%20mean%20here%3F%3C%2FP%3E%3CP%3EIt%20has%20something%20to%20do%20with%20powerapps%20being%20only%20able%20to%20use%20a%20limited%20number%20of%20rows%3F%20500%20I%20think%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20again%20for%20your%20help!%3C%2FP%3E%3CP%3EChristina%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-891381%22%20slang%3D%22en-US%22%3ERe%3A%20Powerapps%20filter%20Gallery%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-891381%22%20slang%3D%22en-US%22%3EYes%2C%20in%20the%20past%2C%20if%20you%20filtered%20on%20a%20choice%20column%20it%20was%20not%20delegated%20which%20means%20you%20could%20only%20filter%20on%20the%20first%20500%20rows%20of%20the%20datasource.%20Now%20it's%20a%20delegable%20data%20type%20so%20you%20can%20filter%20on%20the%20entire%20record%20set%20(returning%20up%20to%20500%2C%20or%202000%20if%20configured%20of%20that%20filter).%3C%2FLINGO-BODY%3E
Occasional Contributor

Hi,

 

I am creating a power app to view and make entries in a sharepoint list.

Now I created a new Screen with a gallery and the source is my sharepoint list. In the list, there is a field that is called "closed" and it has a drop down menu with yes/no. Now I want this particular gallery to only show the lines of the sharepoint list were the field "closed" is set to 'No'. 

Is there any way to do that?

I experimented a bit by changing the following line, but nothing seems to work.

Capture.JPG

For any help I would be greatful!

Thanks

Christina

5 Replies

Hi @christina_hoeglinger,

 

You can use the "Filter" command in the "Items" property to filter the list.

 

Here is my unfiltered app:

1.PNG

 

Here is my filtered app and code:

SortByColumns(Filter([@PowerAppsDemo], Closed = false), "Title", If(SortDescending1, Descending, Ascending))

2.PNG 

 

Unfortunately, using "true" does not work as expected. Here is a version of the code for "true" but be warned you will get "Delegation" warnings.

SortByColumns(Filter([@PowerAppsDemo], Closed <> false), "Title", If(SortDescending1, Descending, Ascending))

3.PNG

I hope this helps.

 

Norm

best response confirmed by christina_hoeglinger (Occasional Contributor)
Solution

It’s a drop down aka choice column with those values and so it’s a delegated query now so if you use filter(data source,closed.value = “no”) in items you will get the result you need.

@Chris Webb thanks for pointing that out. I missed it in the original post.

 

@christina_hoeglinger, Chris' code example should give you what you need.

 

Norm

Thank you so much! I actually was pretty close to this solution, i just forgot the .Value after Closed @Chris Webb 

 

I have follow-up question regarding your post: when you say delegated query, do you mean that the job gets passed on to sharepoint? I think I read about this, but I am not sure if this is what you mean here?

It has something to do with powerapps being only able to use a limited number of rows? 500 I think?

 

Thanks again for your help!

Christina

Yes, in the past, if you filtered on a choice column it was not delegated which means you could only filter on the first 500 rows of the datasource. Now it's a delegable data type so you can filter on the entire record set (returning up to 500, or 2000 if configured of that filter).