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

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 (51,843)