cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
thb65
Frequent Visitor

Gallery Conditional Visible on Sharepoint Yes/No type column

Hi,

 

I want to make records (rows) visible only in the BrowseGallery if they have value Yes (or true) in Sharepoint Yes/No columntype.

 

BrowseGallery Visible property: 

I tried :

If(LookUp(LibraryName,Active=true,true,false))

And tried using the Filter:

Filter(LibraryName,Active = true)

 it comes with error "Expected Boolean value" whereas in LibraryName (Datatype table ) the Active column values are true or false...

 

Any suggestions welcome !

1 ACCEPTED SOLUTION

Accepted Solutions
ganeshsanap
Super User
Super User

@thb65 Replace [LibraryName] with my formula given above, like:

 

SortByColumns(Search(Filter(LibraryName, Active = 1),TextSearchBox1.Text,"s07z","o2jt","wkwr","xf9e","gu7p","OData__x0067_et4"), "s07z", If(SortDescending1, Descending, Ascending))

 


Please click Accept as solution & 👍 if my answer helped you to solve your issue. This will help others to find the correct solution easily. If the answer was useful in other ways, please consider giving it ‌‌👍

View solution in original post

10 REPLIES 10
WarrenBelz
Super User III
Super User III

HI @thb65 ,

The second one should work - are you sure the SharePoint column Active is a yes/no field? I assume LibraryName is your SharePoint list/library name.

You could also try

Filter(
   LibraryName,
   Active
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Eelman
Super User
Super User

@thb65 

Ive always had to use the structure Text(columnName) = "true" to get this to work, ie

 

Filter( LibraryName, Text(Active) = "true")

 

It's always been a weird error to manage.

 

You will get a delegation warning but if your list will never get beyond 2000 records it's fine.

thb65
Frequent Visitor

Hi Warren,

 

Thanks

- the sharepoint column Active is a yes/no type.

- LibraryName is indeed my SP library name

 

your code produces an error: Expected Boolean value.

 

Any other ideas ?

thb65
Frequent Visitor

Hi Eelman,

 

Thanks for the reaction.

 

Your code gives also the error: Expected Boolean value

Location Browsegallery1.Visible

 

on Filter (LibraryName, Text(Active) = "true") = there is an error in this formula. try revising the formula and try running it again. Datatype: table

 

any ideas ?

@thb65 

Add below formula to Items property of Gallery control. It should work for you:

 

Filter(LibraryName, Active = 1)

 

OR

 

Filter(LibraryName, Active = true)

 

Here, LibraryName is the name of SharePoint list/library data source and Active is internal name of Yes/No column. No need to set Visible property of gallery control.

 

Related Threads:

  1. Properly filter SharePoint Yes/No column 
  2. https://rezadorrani.com/index.php/2019/04/14/powerapps-filter-sharepoint-yes-no-column-bug/ 

Please click Accept as solution & 👍 if my answer helped you to solve your issue. This will help others to find the correct solution easily. If the answer was useful in other ways, please consider giving it ‌‌👍

@ganeshsanap 

Thanks - i am using the Items property already with a complex function:

SortByColumns(Search([LibraryName],TextSearchBox1.Text,"s07z","o2jt","wkwr","xf9e","gu7p","OData__x0067_et4"), "s07z", If(SortDescending1, Descending, Ascending))

 

Please can you show how  the Items property can be extended with your suggested Filter above ?   i will keep then visible unchanged (true)

 

thanks

 

ganeshsanap
Super User
Super User

@thb65 Replace [LibraryName] with my formula given above, like:

 

SortByColumns(Search(Filter(LibraryName, Active = 1),TextSearchBox1.Text,"s07z","o2jt","wkwr","xf9e","gu7p","OData__x0067_et4"), "s07z", If(SortDescending1, Descending, Ascending))

 


Please click Accept as solution & 👍 if my answer helped you to solve your issue. This will help others to find the correct solution easily. If the answer was useful in other ways, please consider giving it ‌‌👍

View solution in original post

@ganeshsanap 

Thanks !  - you gave me the solution ! please note that indeed  Active = 1 must be used.

 

@thb65 ,

That is weird (and thanks @ganeshsanap for the alternative solution), but I have dozens of queries on Boolean columns in older lists (I do not use the columns any more for Delegation issues - this blog of mine may be useful for you) and have never needed to use =1 or =0 (which is the underlying value in a Boolean). I just re-tested several here with the same result - must be a Regional issue.

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (94,922)