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
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

PA Community Call

Power Apps Community Call

Next call is happening on April 21st at 8a PST.

MBAS Carousel

Sign up for our May 4th event!

May the fourth be with you, join us online!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors
Users online (8,896)