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
Advocate I
Advocate 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
Super User 2 - 2022 Congratulations 768x460.png

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

<
Users online (2,532)