cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
peterstylias
Helper I
Helper I

Hide a record in a gallery

My datasource is an excel file.  I have records being displayed in a gallery.  Each record has a "Status" column either Open or Closed.   I want to hide record(s) in the gallery if the "Status" column value is "Closed".  Right now, this is what is on my Items property:

SortByColumns(
Search(
[@LogTable],
TextSearchBox1.Text,
"DetailedDescription",
"FunctionalArea",
"Submittedby",
"ShortTitle",
"Status"
),
"Submittedby",
If(
SortDescending1,
Descending,
Ascending
)
)

 

1 ACCEPTED SOLUTION

Accepted Solutions

Sorry for all the back and forth, I've been doing this freetext without building a test in PowerApps itself. I see another error in my code. Try this:

SortByColumns(
Search(
Filter([@LogTable],Status="Open"),
TextSearchBox1.Text,
"DetailedDescription",
"FunctionalArea",
"Submittedby",
"ShortTitle",
"Status"
)
,"Submittedby",
If(
SortDescending1,
Descending,
Ascending
)
)

View solution in original post

10 REPLIES 10
EricLott
Super User
Super User

You'll just need to add a filter.

 

SortByColumns(
Filter(
Search(
[@LogTable],
TextSearchBox1.Text,
"DetailedDescription",
"FunctionalArea",
"Submittedby",
"ShortTitle",
"Status"
),
"Submittedby",
If(
SortDescending1,
Descending,
Ascending
)
,Status,"Open")
)

 

@EricLott, did that and gave me bunch of errors.  Please see attached.

I see. The SortByColumns arguments got shifted when I was typing it out. Try this

SortByColumns(
Filter(
Search(
[@LogTable],
TextSearchBox1.Text,
"DetailedDescription",
"FunctionalArea",
"Submittedby",
"ShortTitle",
"Status"
)
,Status,"Open")
,"Submittedby",
If(
SortDescending1,
Descending,
Ascending
)
)

@EricLott, no error now but gallery is blank and giving me a triangular exclamation Warning: This predicate is a literal value and does not reference the input table.

Maybe we need to flip the Search and Filter functions. Try this:

SortByColumns(
Search(
Filter([@LogTable],Status,"Open"),
TextSearchBox1.Text,
"DetailedDescription",
"FunctionalArea",
"Submittedby",
"ShortTitle",
"Status"
)
,"Submittedby",
If(
SortDescending1,
Descending,
Ascending
)
)

@EricLott, still the same warning and still blank.

Sorry for all the back and forth, I've been doing this freetext without building a test in PowerApps itself. I see another error in my code. Try this:

SortByColumns(
Search(
Filter([@LogTable],Status="Open"),
TextSearchBox1.Text,
"DetailedDescription",
"FunctionalArea",
"Submittedby",
"ShortTitle",
"Status"
)
,"Submittedby",
If(
SortDescending1,
Descending,
Ascending
)
)

View solution in original post

@EricLott, that resolves all the errors now.  appreciate your time looking into this.

cwebb365
Impactful Individual
Impactful Individual

I would use this,

SortByColumns(
Search(
Filter([@LogTable],Status <> "Closed"),
TextSearchBox1.Text,
"DetailedDescription",
"FunctionalArea",
"Submittedby",
"ShortTitle",
"Status"
)
,"Submittedby",
If(
SortDescending1,
Descending,
Ascending
)
)

In case you have other statuses.

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

secondImage

Demo Extravaganza Winner Announcement

Please join us on Wednesday, July 21st at 8a PDT. We will be announcing the Winners of the Demo Extravaganza!

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,158)