cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
nichtzuhelfen
Regular Visitor

Checking a false variable from SharePoint if it is false returns false

Hi, I have a SharePoint list with a column "Hidden" which has boolean data type. In Power Apps I'm showing the items in a table. By a click on a button the user can filter the items either by only visible, only invisible or all. My filter function for the table looks like this:

 

Filter(
[@MyList];
showVisibleProducts = "All" || 
showVisibleProducts = "Visible" && Hidden = false ||
showVisibleProducts = "Hidden" && Hidden = true
);

 

It works fine for all and hidden products, but for the visible ones the "Hidden = false" fails. Even if I print out the "Hidden" attribute it says:

nichtzuhelfen_0-1646295355025.png

My solution is to use "in", like: Hidden in "false". That works but does anyone has an idea why the comparison with "=" is wrong?

1 REPLY 1
jimbobcook1
Resolver I
Resolver I

Could you change it slightly and run an If statement going through each option?

 

For example if on your Gallery Items you put the following

Items = If(showVisibleProducts = "All", SharePointListNameHere, showVisibleProducts = "Hidden", Filter(SharePointNameHere,Hidden = "Hidden"), showVisibleProducts = "Visible", Filter(SharePointNameHere,Hidden = "Visible"))

 

Not had a chance to test it but that should hopefully go through each option till it's true then apply the filter etc, you could also throw a sort at the start to sort by ID if you wanted.

 

Also I hope it makes sense haha

 

Cheers

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,262)