I have a need to filter a gallery based on multiple conditions in the Items property.
1. filter based on text entered in search field:
Filter(GroupBy(colSPList, "Title", "Status"), Search.Text in Title)
colSPList is a collection based SharePoint list because the delegation errors get getting in the way.
"Status" is a single-select dropdown in SharePoint.
"Search" is a Text Input search field on the screen.
2. Additionally, I need to filter the gallery items for any items that do not have Status = Do Not Use.
Filter(colSPList, Not("Suspended" in ThisRecord.Status.Value))
Individually, each of these Filter statemtnMy challenge seems to be to combine both filter statements into one. Somehow I keep getting error messages regardless of how I try to put this together.
I also tried to have the Status as a text field in the gallery and filter based on that. No luck so far but I would be happy to reconsider that, too.
Any input would be greatly appreciated. Thanks!
Solved! Go to Solution.
Hi @Susi ,
Try this for a start
Filter(
GroupBy(
AddColumns(
colSPList,
"StatValue",
Status.Value
),
"Title",
"StatValue",
"Data"
),
(IsBlank(SearchSearch.Text) || SearchSearch.Text in Title) &&
StatValue <> "Suspended"
)
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.
Hi @Susi ,
Try this for a start
Filter(
GroupBy(
AddColumns(
colSPList,
"StatValue",
Status.Value
),
"Title",
"StatValue",
"Data"
),
(IsBlank(SearchSearch.Text) || SearchSearch.Text in Title) &&
StatValue <> "Suspended"
)
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.
Hi @Susi ,
Just checking if you got the result you were looking for on this thread. Happy to help further if not.
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.
@WarrenBelz , thank you!! Your solution is amazing. (Sorry that it took me some time to respond, I had to shift gears on my end for a couple of weeks.)
There was just one thing that I needed to change. The SPList could have two entries with the same title. That means that I cannot compare text and table, I think.
StatValue <> "Suspended"
threw an error and this piece had to be changed to
Not("Suspended" in StatValue.StatValue)
to work.
That resulted in the following:
Filter(
GroupBy(
AddColumns(
colSPList,
"StatValue",
Status.Value
),
"Title",
"StatValue"
),
(IsBlank(SearchSearch.Text) || SearchSearch.Text in Title) &&
Not("Suspended" in StatValue.StatValue)
)
This seems to work fine from what I can tell.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
184 | |
53 | |
50 | |
36 | |
34 |
User | Count |
---|---|
270 | |
91 | |
82 | |
76 | |
75 |