cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SimenOmmundsen
Level: Powered On

Multiple filters for one gallery

Hello everyone!

 

Im struggling with adding multiple filters for the same gallery. Currently im using this filter: 

 

Filter('[dbo].[V_SSE_EndDeviceEvents_LastPeriod]'; EndDeviceEventType = Gallery4.Selected.'CIM attribute ')

 

This filters the gallery based on the selection of another gallery, but i would also like to add a sort button to the same gallery. Can anyone help me with this?  

4 ACCEPTED SOLUTIONS

Accepted Solutions
Dual Super User
Dual Super User

Re: Multiple filters for one gallery

Hi @SimenOmmundsen 

 

Add the following config for setting up the sorting:
 
Screen : OnVisible -> Set(SortAscending,true)
 
Sort Icon/Button -> OnSelect -> Set(SortAscending,!SortAscending)
 
Gallery -> Items -> Sort(Filter('[dbo].[V_SSE_EndDeviceEvents_LastPeriod]'; EndDeviceEventType = Gallery4.Selected.'CIM attribute '),EndDeviceEventType, If(SortAscending,"Ascending","Descending"))
 
The higlighted part need to be replaced with the column you want to use as sort key.
 
Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

SimenOmmundsen
Level: Powered On

Re: Multiple filters for one gallery

Yes i have done this as well. But my problem is that in the Gallery -> Items box, i already have this text:

 

Filter('[dbo].[V_SSE_EndDeviceEvents_LastPeriod]'; EndDeviceEventType = Gallery4.Selected.'CIM attribute ')

 

So where do i put in the sort code?

View solution in original post

Dual Super User
Dual Super User

Re: Multiple filters for one gallery

Hey @SimenOmmundsen 

 

You need to remove the existing code and add the expression in place of it.
 
Expression: Sort(Filter('[dbo].[V_SSE_EndDeviceEvents_LastPeriod]'; EndDeviceEventType = Gallery4.Selected.'CIM attribute '),EndDeviceEventType, If(SortAscending,"Ascending","Descending"))
 
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

Highlighted
SimenOmmundsen
Level: Powered On

Re: Multiple filters for one gallery

But is there some way of combining these two codes? Because i want to be able to do both in the same gallery. So i would like to combine this code: 

 

Filter('[dbo].[V_SSE_EndDeviceEvents_LastPeriod]'; EndDeviceEventType = Gallery4.Selected.'CIM attribute ')

 

And this: 

 

Sort(Filter('[dbo].[V_SSE_EndDeviceEvents_LastPeriod]'; EndDeviceEventType = Gallery4.Selected.'CIM attribute '),EndDeviceEventType, If(SortAscending,"Ascending","Descending"))

 

View solution in original post

5 REPLIES 5
Dual Super User
Dual Super User

Re: Multiple filters for one gallery

Hi @SimenOmmundsen 

 

Add the following config for setting up the sorting:
 
Screen : OnVisible -> Set(SortAscending,true)
 
Sort Icon/Button -> OnSelect -> Set(SortAscending,!SortAscending)
 
Gallery -> Items -> Sort(Filter('[dbo].[V_SSE_EndDeviceEvents_LastPeriod]'; EndDeviceEventType = Gallery4.Selected.'CIM attribute '),EndDeviceEventType, If(SortAscending,"Ascending","Descending"))
 
The higlighted part need to be replaced with the column you want to use as sort key.
 
Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

SimenOmmundsen
Level: Powered On

Re: Multiple filters for one gallery

Yes i have done this as well. But my problem is that in the Gallery -> Items box, i already have this text:

 

Filter('[dbo].[V_SSE_EndDeviceEvents_LastPeriod]'; EndDeviceEventType = Gallery4.Selected.'CIM attribute ')

 

So where do i put in the sort code?

View solution in original post

Dual Super User
Dual Super User

Re: Multiple filters for one gallery

Hey @SimenOmmundsen 

 

You need to remove the existing code and add the expression in place of it.
 
Expression: Sort(Filter('[dbo].[V_SSE_EndDeviceEvents_LastPeriod]'; EndDeviceEventType = Gallery4.Selected.'CIM attribute '),EndDeviceEventType, If(SortAscending,"Ascending","Descending"))
 
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

Highlighted
SimenOmmundsen
Level: Powered On

Re: Multiple filters for one gallery

But is there some way of combining these two codes? Because i want to be able to do both in the same gallery. So i would like to combine this code: 

 

Filter('[dbo].[V_SSE_EndDeviceEvents_LastPeriod]'; EndDeviceEventType = Gallery4.Selected.'CIM attribute ')

 

And this: 

 

Sort(Filter('[dbo].[V_SSE_EndDeviceEvents_LastPeriod]'; EndDeviceEventType = Gallery4.Selected.'CIM attribute '),EndDeviceEventType, If(SortAscending,"Ascending","Descending"))

 

View solution in original post

SimenOmmundsen
Level: Powered On

Re: Multiple filters for one gallery

Oh sorry i didn't read the code you sent me correctly.. It works now! Thanks!

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 358 members 5,963 guests
Please welcome our newest community members: