cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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

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

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
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

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

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (9,707)