cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jonathandwintr
New Member

Multi filter/Sort on gallery

Hi,

Initial request:
Another booking app: Using Apps Using Formulas
I would like to filter/sort Gallery A  based on 4 conditions (the powerapp gallery is linked to a sharepoint list):

-Is this type of item available (type of item is a column in the sharepoint list)
-Is the item available? (available hours are logged on another sharepoint list)
-Does the name of the item contain what I put in a search box/label beforehand in my flow?
-Whatever is above, I want it to be descending or descending based on a sorting boolean

At this moment, I managed to fill 3 out of 4 of those conditions thanks to these formulas:

 

first formula:
SortByColumns(Filter(Sharepointlist, StartsWith(SPColumn1.Value,powerappLabel.Text)), "Title", If(Boolean, Descending, Ascending))

-> Gallery results are successfully filtered based on me clicking a label in Powerapp, if this item start the same as a value on my sharepoint column. Besides, whenever my boolean changes, the sorting order changes


second formula:
Filter(Sharepointlist,(Title in Filter( Sharepointlist2,
Value(Startdec) >= StartDate ).SharepointColumn2))

-> Gallery results are successfully filtered based on the availabilities of an item on another sharepoint list, if they got the same name.
-> Actually the pink font a simplified version of the formula, because I assume it's a syntax problem.

 

I would mix them both formulas.

At this moment, it's either one or the other , so it's only 2 or 3 out of 4 of my conditions that are met 😞

 

A lot of documentation is available online, but my scenario is a mix and thus hard to find.

I can give you more screenshots or explanation if needed, thanks whoever reads this.

1 ACCEPTED SOLUTION

Accepted Solutions
v-yutliu-msft
Community Support
Community Support

Hi @jonathandwintr ,

Do you want to combine two filter rules together?

Could you tell me the relationship between the two filter rules?

1)If relationship is "AND", try this formula:

SortByColumns(
               Filter(Sharepointlist, StartsWith(SPColumn1.Value,powerappLabel.Text),
                                      Title in Filter( Sharepointlist2,
Value(Startdec) >= StartDate ).SharepointColumn2
                      ), 
               "Title", If(Boolean, Descending, Ascending))

 2)If relationship is "OR", try this formula:

SortByColumns(
               Filter(Sharepointlist, StartsWith(SPColumn1.Value,powerappLabel.Text)||
                                      Title in Filter( Sharepointlist2,
Value(Startdec) >= StartDate ).SharepointColumn2
                      ), 
               "Title", If(Boolean, Descending, Ascending))

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-yutliu-msft
Community Support
Community Support

Hi @jonathandwintr ,

Do you want to combine two filter rules together?

Could you tell me the relationship between the two filter rules?

1)If relationship is "AND", try this formula:

SortByColumns(
               Filter(Sharepointlist, StartsWith(SPColumn1.Value,powerappLabel.Text),
                                      Title in Filter( Sharepointlist2,
Value(Startdec) >= StartDate ).SharepointColumn2
                      ), 
               "Title", If(Boolean, Descending, Ascending))

 2)If relationship is "OR", try this formula:

SortByColumns(
               Filter(Sharepointlist, StartsWith(SPColumn1.Value,powerappLabel.Text)||
                                      Title in Filter( Sharepointlist2,
Value(Startdec) >= StartDate ).SharepointColumn2
                      ), 
               "Title", If(Boolean, Descending, Ascending))

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (3,116)