cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Ryball
Frequent Visitor

Filter Gallery Help

I have 2 sharepoint lists :

 

List A

List B

 

In List A i have :

User Name

User Address

 

List B i have :

Managers :  Lookup field to List A with multiple choises 

 

So what im looking for is when i have selected User in list A i whant to display all the Managers that are connected to that user.

So One manager can have multiple users connected to it.

I tried allot of Filtering and lookups but end up with empty results or just errors.

Any help would be great !

 

 

 

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

(You have more than one manager for an employee?)

 

Whether you are looking up the manager, or you are looking up employee names, it's a similar approach. You filter the gallery on the screen based on what you're trying to find. So you can reverse my sample to get lookup up employees rather than managers.

 

Side Point: Since you are changing screens you will need to carry the variable for the selected name over with your Navigate formula using something like this so that you can use the variable name in the filter:
Navigate(ManagerScreen1, ScreenTransition.Cover, {VarX: ddSelectEmployee.Selected.Value})

 

However, you are probably having problems because PowerApps does not yet support SharePoint columns that involve multiple values or multiple selections. So it would be better to use a format closer to my SharePoint list to avoid having issues retrieving or updating multi-select columns. To learn about the types of columns supported please see here:

https://powerapps.microsoft.com/en-us/tutorials/connection-sharepoint-online/

 

Thank you,

Audrie

 

View solution in original post

7 REPLIES 7
audrieg
Power Automate
Power Automate

Have you tried using the Office 365 Users Connection? Please check this option out, as it may be a simpler approach than a multi-list scenario (especially if those lists are large). Take a look and let me know if that would work for you (if not I can put together a simple of what you're doing now and provide step-by-step).

 

https://powerapps.microsoft.com/en-us/tutorials/connection-office365-users/

 

Thank you,

Audrie

Ryball
Frequent Visitor

Thank you but not what im looking for.

 

Users im talking about is not WAD users its just users in a list and those users can have multiple managers but not in an AD way.

 

 

But the link you gave me was huge help with another project im working on 🙂

 

 

Ok! Understood. It sounds like you'll need to use Lookup and Filter functions and at least 1 gallery to select from to get where you're trying to get.

 

If the function references aren't quite enough, could you include a screen shot of where you are so far in your app build, and/or a pencil sketch of how you want the app screen to look please? This will help me to hit the target on the bullseye next time (smiles).

 

Thank you,

Audrie

 

Ryball
Frequent Visitor

Sharepoint ListA

Powerapps Gallery name : userlist

 

Name:

Name1

Name2

Name3

Name4

 

Sharepoint ListB

 

Manager:

ManagerName1                   Name1

                                            Name3

                                            Name4

 

ManagerName2                   Name2

                                            Name4

 

 

When i select Name4 i whant to display what Managers has Name4 in their list, so in in the example above i should show ManagerName1 and ManagerName2

 

I have loads of other list that i filter, but this i cant figure out 😞

audrieg
Power Automate
Power Automate

Thank you for further clarification.

There is no manager name to the left of name4 in the second list...so I assume you just didn't copy down....

 

I did it this way...but there are a few ways you can do it. This way is the fastest IMO (just took a few minutes):

 

1. Here is a picture of my ListA which has the managers name (since there is one manager to many employees the manager is by himself in my example)

ListA-Managers.PNG

 

 

2. Here is a picture of my ListB which has the employees in the title column, and a lookup to the title column of ListA. So every employee has an associated manager (although I didn't try to give every manager an employee for this example).

 

ListB-Employee.PNG

 

3. I let PowerApps do my work for me and autogenerated a PowerApp from List B

generateit.PNG

 

3. Once the app was built, I shortened the gallery on screen 1 to fit in a new Drop Down List (Insert>Control>Dropdown) that I named ddSelectManager.

dropdown.png

 

4. I added an easy distinct function to the OnSelect property of ddSelectManager so that I could pick the manager name from it.

Distinct(ListA,Title)

 

5. Lastly, I changed the gallery Items property

from this:

SortByColumns(Search(ListB, TextSearchBox1.Text, "Title"), "Title", If(SortDescending1, Descending, Ascending))

to this:

SortByColumns(Search(Filter(ListB,ddSelectManager.Selected.Value in Manager.Value), TextSearchBox1.Text, "Title"), "Title", If(SortDescending1, Descending, Ascending))

 

Which effectively filters the list of employees by the manager selected. This approach can be used for many things....for example we could set the "Text" property of a TextBox under the drop down if we wanted to count direct reports:

CountIf(ListB,ddSelectManager.Selected.Value in Manager.Value) 

 

See my finished version below:

 

finished.PNG

 

(If I'm still misunderstanding your goal, please add a screen shot of your PowerApp - it's a bit easier for me to see where you are going if I look at your design screen(s).)

 

Thank you for your patience,

Audrie

Ryball
Frequent Visitor

Thank you again.

 

But as i said, i need to filter the managers based on the user selected.

 

 

Sharepoint list of Managers :

ManagerList.PNG

This is the Gallery where i chose the user , When i press the icon "Cirle in RED" i go to the Managers for that user.

 

KlientList.PNG

 

Managers view, and this is where i need to filter only the managers that are connected to this user, "yes users in the managers list is a multiple choise as shown in the first picture."

FilterView.PNG

 

 

 

 

 

 

 

 

(You have more than one manager for an employee?)

 

Whether you are looking up the manager, or you are looking up employee names, it's a similar approach. You filter the gallery on the screen based on what you're trying to find. So you can reverse my sample to get lookup up employees rather than managers.

 

Side Point: Since you are changing screens you will need to carry the variable for the selected name over with your Navigate formula using something like this so that you can use the variable name in the filter:
Navigate(ManagerScreen1, ScreenTransition.Cover, {VarX: ddSelectEmployee.Selected.Value})

 

However, you are probably having problems because PowerApps does not yet support SharePoint columns that involve multiple values or multiple selections. So it would be better to use a format closer to my SharePoint list to avoid having issues retrieving or updating multi-select columns. To learn about the types of columns supported please see here:

https://powerapps.microsoft.com/en-us/tutorials/connection-sharepoint-online/

 

Thank you,

Audrie

 

Helpful resources

Announcements
Super User 2 - 2022 Congratulations 768x460.png

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

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.

<
Users online (4,869)