cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Dknight7
Helper III
Helper III

Filter for manager group

IM trying to filter my data table by the manager types from my sharepoint list:

Screen Shot 2022-07-22 at 9.17.24 AM.pngScreen Shot 2022-07-22 at 9.18.26 AM.png

1 ACCEPTED SOLUTION

Accepted Solutions
poweractivate
Super User
Super User

@Dknight7 

 

If you want the category to be in ABC order, you can add the column to SortByColumns and give it a SortOrder of Ascending

 

SortByColumns(
   Filter('Employee Activity List',
      Employee.DisplayName = User().FullName,
      Status.Value = "Needs Approval",
      Manager_x0020_Group.Value = "Self-Improvement"
   ),
   "SubmissionDate", SortOrder.Descending,
   "Category", SortOrder.Ascending

)

 

 

The important part is "Category",  Ascending.

 

SortByColumns(
   <<source>>,
   "SubmissionDate", SortOrder.Descending,
   "Category", SortOrder.Ascending

)

 

 

Because SortOrder.Ascending is default value, and because this is last column and SortOrder is optional, you can instead write this:

 

SortByColumns(
   <<source>>,
   "SubmissionDate", SortOrder.Descending,
   "Category"

)

 

 

Note that if "Category" is not desired to be the last column specified, the SortOrder is not optional, and should be written like this:

 

SortByColumns(
   <<source>>,
   "Category", SortOrder.Ascending,
   "SubmissionDate", SortOrder.Descending
   

)

 

 

Writing something like "Category","SubmissionDate" like the below would give an error and should not be done:

 

//DO NOT DO THIS
SortByColumns(
   <<source>>,
   "Category",//DO NOT DO THIS
   "SubmissionDate", SortOrder.Descending
   //DO NOT DO THIS

)
//DO NOT DO THIS

 

 

Check if it helps @Dknight7 

View solution in original post

7 REPLIES 7
WiZey
Continued Contributor
Continued Contributor

Hello @Dknight7 ,

 

By "Manager Type", did you mean "Manager Group"?

 

What filter have you tried so far which didn't work?

 

How do you want your data to be filtered?

I just want to filter the data based off the manager groups: centers of excellence,  responding to rfsp, social media, etc.  They're the same as the categories

WiZey
Continued Contributor
Continued Contributor

How do you want to filter the manager? With a dropdown or a text input?

 

What type of column did you use? Is it a choice-type or a lookup-type?

 

A choice-type column requires the use of a subproperty « .Value » whenever we'll try to filter the manager, whereas a lookup-type is more complicated as it'll need a "LookUp()" to first retrieve the record from its source table before comparison.

 

Sorry for all the questions, the subject is rather vague to give a concrete answer.

poweractivate
Super User
Super User

@Dknight7 

 

Just do something like:

SortByColumns(
   Filter('Employee Activity List',
      Employee.DisplayName = User().FullName,
      Status.Value = "Needs Approval",
      'Manager Group'.Value = "Self-Improvement"
   ),
   "SubmissionDate", Descending
)

 

If that doesn't work or gives some error, then try this instead and see if it works better:

 

SortByColumns(
   Filter('Employee Activity List',
      Employee.DisplayName = User().FullName,
      Status.Value = "Needs Approval",
      Manager_x0020_Group.Value = "Self-Improvement"
   ),
   "SubmissionDate", Descending
)

 

See if it works.

 

Other than this, as @WiZey says some more detail might help such as what formula you tried or what it is you want to do.

 

 

 

 

This works, but now I need to organize it by the same group in alphabetical order:

for example:

 

-Responding to rfps

-Responding to rfps

-Responding to rfps

-Self improvement

-Self improvement

 

Screen Shot 2022-07-22 at 1.01.36 PM.png

I wanted them filtered in the data table as well, similar to how it filters the employee name

 

centers of excellence

centers of excellence

responding to rfsp

responding to rfsp

social media

poweractivate
Super User
Super User

@Dknight7 

 

If you want the category to be in ABC order, you can add the column to SortByColumns and give it a SortOrder of Ascending

 

SortByColumns(
   Filter('Employee Activity List',
      Employee.DisplayName = User().FullName,
      Status.Value = "Needs Approval",
      Manager_x0020_Group.Value = "Self-Improvement"
   ),
   "SubmissionDate", SortOrder.Descending,
   "Category", SortOrder.Ascending

)

 

 

The important part is "Category",  Ascending.

 

SortByColumns(
   <<source>>,
   "SubmissionDate", SortOrder.Descending,
   "Category", SortOrder.Ascending

)

 

 

Because SortOrder.Ascending is default value, and because this is last column and SortOrder is optional, you can instead write this:

 

SortByColumns(
   <<source>>,
   "SubmissionDate", SortOrder.Descending,
   "Category"

)

 

 

Note that if "Category" is not desired to be the last column specified, the SortOrder is not optional, and should be written like this:

 

SortByColumns(
   <<source>>,
   "Category", SortOrder.Ascending,
   "SubmissionDate", SortOrder.Descending
   

)

 

 

Writing something like "Category","SubmissionDate" like the below would give an error and should not be done:

 

//DO NOT DO THIS
SortByColumns(
   <<source>>,
   "Category",//DO NOT DO THIS
   "SubmissionDate", SortOrder.Descending
   //DO NOT DO THIS

)
//DO NOT DO THIS

 

 

Check if it helps @Dknight7 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Carousel_PP_768x460_Wave2 (1).png

2022 Release Wave 2 Plan

Power Platform release plan for the 2022 release wave 2 describes all new features releasing from October 2022 through March 2023.

Top Solution Authors
Top Kudoed Authors
Users online (2,654)