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

Filtering a dropdown box with boolean

Hi all,

 

I have a list called Builders that im trying to pull data from in a dropdown box, however i only want to pull current/active builders from the list as its quite a large list.

 

In the Builders list i have a colum called Builders_x0020_Name and i also have a Boolean column that is called Current and each builder holds a YES/NO value.  I'm just wanting the drop down list to pull the company name of the current builders.

 

I've done a fair bit of playing around and some research but i cant understand why this wont work.  Below is the formula  - when inputed into powerapps a red sqiggly line appears under the = sign

 

Filter(Builders.Company_x0020_Name,Builders.Current = 1)

 

Any thoughts.

 

Thanks 

19 REPLIES 19
samuelJ
Level 8

Re: Filtering a dropdown box with boolean

Not extreamly familiar with list, mostly worked with sql tables.

 

Try below code:

Filter(Builders, Builders.Current = 1)

Then to get column "Builders_x0020_Name" to be the value in the drop down, go to advanced tab and see below screen shot.  Set "Value" to be your column.

 

dropdown.PNG

 

d3ell
Level: Powered On

Re: Filtering a dropdown box with boolean

Thanks for your reply,  Not working.  Still have a red squiggly line under the = sign

Any further thoughts?

d3ell
Level: Powered On

Re: Filtering a dropdown box with boolean

powerapps.png

Super User
Super User

Re: Filtering a dropdown box with boolean

Hi @d3ell,

The Items property of the dropdown should be:

Filter(Builders, Current=true)

You can wrap the whole thing in a Sort

Sort(Builders,Current=true),Builders_x0020_Name,Ascending)

Then click on your dropdown control and in the right hand side of the screen under the Advanced tab and half way down is a dropdown called Value, click it and select Builders_x0020_Name from the list. In my example I wanted to show the Shipper's name.Capture.PNG

 

 

The reason why it didn't work before is that Sharepoint Yes/No columns reduce to true/false unlike Sql where Yes/No reduces to 1 or 0.  If this answers your question, please mark the thread as solved.  

d3ell
Level: Powered On

Re: Filtering a dropdown box with boolean

Thanks for your reply, looks like we’re going in the right direction, however when I use the code for the filter I keep getting the sites that aren’t current. Ie. The ones that say no in my sharepoint list!? I’ve tried changing the formula to false and I just get the same results. I’ve also tried changing developments from the builders list from not current(no) to current (yes) and now they’ve dissapeared from the list. Any thoughts??

Also. The sort doesn’t work. I get a red underline on the comma after current=true),

See pic attached.
Super User
Super User

Re: Filtering a dropdown box with boolean

@d3ell,

What is the column type for Current?  As a quick test, please change Filter(Builders, Current=true) to Filter(Builders, Current.Value=true) and see if that works.

Highlighted
d3ell
Level: Powered On

Re: Filtering a dropdown box with boolean

It’s a Boolean type

When I change the formula to what you asked I get a red line under value
Super User
Super User

Re: Filtering a dropdown box with boolean

Yeah, I just tried it and it didn't work.  I looked at one of my Sharepoint lists and  Yes/No columns are reduced to true and false on my side.  My formula for filtering a Produce_1 list by discontinued Yes/No worked perfectily.

Filter(Products_1,Discontinued=false). If you remove the Sort, did the filter work for you?

d3ell
Level: Powered On

Re: Filtering a dropdown box with boolean

Sorry not sure what you mean here?  "If you remove the Sort, did the filter work for you?"