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

Apply Sort to Gallery following complex filter delgated to buttons

Hey all

 

Hope someone can help

 

I have set up quite a complex filter and I have delegated the filters to each button to make the filter more manageable.

 

I have a sort button and all I’m trying to is apply this sort to the gallery , to sort my name.

 

My formula is below but I’m struggling to incorporate it

 

If('Find Resource Search'.Text = ""

   And 'Currently Available'.Value = false

   And 'Not With Client'.Value = false

   And 'Capacity Hours Per Week Input'.Text = "",

   Filter(Resource, AzureActiveDirectoryObjectID <> ""),

 

   Filter(Resource, 'Full Name'                 in FindResourceCollection.Full_x0020_Name

           &&         Status                     in FindResourceCollection.Status

           &&       'Available To'             in FindResourceCollection.'Available To'

           &&       'Available From'           in FindResourceCollection.'Available From'

           &&       'Capacity Hrs Per Week'     in FindResourceCollection.'Capacity Hrs Per Week'))

 

This bit here...

SortByColumns(Resource, "Full_x0020_Name",If(SortResourceDescending,Descending,Ascending))

 

Hope somebody can help! 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Apply Sort to Gallery following complex filter delgated to buttons

I haven't tested this but it should be pretty close.  You need to wrap the each Filter in the SortByColumns like this:

If('Find Resource Search'.Text = ""
   And 'Currently Available'.Value = false
   And 'Not With Client'.Value = false
   And 'Capacity Hours Per Week Input'.Text = "",
SortByColumns( Filter(Resource, AzureActiveDirectoryObjectID <> ""),
"Full_x0020_Name",If(SortResourceDescending,Descending,Ascending), SortByColumns(
Filter(Resource, 'Full Name' in FindResourceCollection.Full_x0020_Name
&& Status in FindResourceCollection.Status
&& 'Available To' in FindResourceCollection.'Available To' && 'Available From' in FindResourceCollection.'Available From' && 'Capacity Hrs Per Week' in FindResourceCollection.'Capacity Hrs Per Week'),
"Full_x0020_Name",If(SortResourceDescending,Descending,Ascending))

The enter Filter statement becomes the source for the SortByColumns.  It is as if you are substitution the Filter clause for "Resource" in your SortByColumns.

2 REPLIES 2
Super User
Super User

Re: Apply Sort to Gallery following complex filter delgated to buttons

I haven't tested this but it should be pretty close.  You need to wrap the each Filter in the SortByColumns like this:

If('Find Resource Search'.Text = ""
   And 'Currently Available'.Value = false
   And 'Not With Client'.Value = false
   And 'Capacity Hours Per Week Input'.Text = "",
SortByColumns( Filter(Resource, AzureActiveDirectoryObjectID <> ""),
"Full_x0020_Name",If(SortResourceDescending,Descending,Ascending), SortByColumns(
Filter(Resource, 'Full Name' in FindResourceCollection.Full_x0020_Name
&& Status in FindResourceCollection.Status
&& 'Available To' in FindResourceCollection.'Available To' && 'Available From' in FindResourceCollection.'Available From' && 'Capacity Hrs Per Week' in FindResourceCollection.'Capacity Hrs Per Week'),
"Full_x0020_Name",If(SortResourceDescending,Descending,Ascending))

The enter Filter statement becomes the source for the SortByColumns.  It is as if you are substitution the Filter clause for "Resource" in your SortByColumns.

mfosterbdp
Level: Powered On

Re: Apply Sort to Gallery following complex filter delgated to buttons

Thank


@LRVinNC wrote:

I haven't tested this but it should be pretty close.  You need to wrap the each Filter in the SortByColumns like this:

If('Find Resource Search'.Text = ""
   And 'Currently Available'.Value = false
   And 'Not With Client'.Value = false
   And 'Capacity Hours Per Week Input'.Text = "",
SortByColumns( Filter(Resource, AzureActiveDirectoryObjectID <> ""),
"Full_x0020_Name",If(SortResourceDescending,Descending,Ascending), SortByColumns(
Filter(Resource, 'Full Name' in FindResourceCollection.Full_x0020_Name
&& Status in FindResourceCollection.Status
&& 'Available To' in FindResourceCollection.'Available To' && 'Available From' in FindResourceCollection.'Available From' && 'Capacity Hrs Per Week' in FindResourceCollection.'Capacity Hrs Per Week'),
"Full_x0020_Name",If(SortResourceDescending,Descending,Ascending))

The enter Filter statement becomes the source for the SortByColumns.  It is as if you are substitution the Filter clause for "Resource" in your SortByColumns.



you so much !Worked a treat Smiley Happy 

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

PowerApps Monthly Community Call

Next Wednesday, August 21st at 8am PDT

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

SixthImage

Power Summit Australia 2019

August 20-23rd 2019

Users Online
Currently online: 41 members 4,036 guests
Please welcome our newest community members: