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
LRVinNC
Level 10

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
LRVinNC
Level 10

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