cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
webuildwood
Level: Powered On

Creating a Collection based on the return of a filtered data source

Hello again,

 

This time around I'm looking to create a collection based on a filtered data source. I have a SharePoint list with several columns, one of which being names, and another one being a boolean true/false. I want to filter the data set to only return the names of people where the boolean column shows true. Then I want to take those names and put them into a collection. I've tried several different ways of setting the collection using the same sorts of filtering syntax I use for gallery filtering, but I haven't had much luck so far. 

 

Any suggestions? Sorry if this has been posted before, I was having trouble finding a one-for-one. 

4 REPLIES 4
Super User
Super User

Re: Creating a Collection based on the return of a filtered data source

Long known issue with filtering Sharepoint Yes/No fields...

Try:
   Collect(collectionName, Filter(SharePointSource, BooleanField=1))

 

In this case you're using 1 for true and 0 for false conditions.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
webuildwood
Level: Powered On

Re: Creating a Collection based on the return of a filtered data source

Thanks, Randy. That produces a formula error "left value is boolean type, right value is number type", unfortunately. The other thing that happens is I get errors on other fields that want to reference the collection for a particular item that will say "Invalid schema, expected a one-column table" since the filter is returning more than one result. 

Super User
Super User

Re: Creating a Collection based on the return of a filtered data source

It has it's places where it seems to work well and others where not.  Mostly depending on how many other things you have dependant on it or otherwise deriving from it.

I did a little sample on a SharePoint list with the 0 and 1 options and it worked fine.  It was, however, a simple test.  There were no other forms or collections or anything that were at play that derived from it.

 

You might want to take a look at this post for more information on another option.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Super User
Super User

Re: Creating a Collection based on the return of a filtered data source

Oh, one other - there is actually a "would be nice to fix this bug idea" here at this post.

Go cast your vote...

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

Helpful resources

Announcements
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (8,319)