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 !
Solved! Go to Solution.
(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
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
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
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 😞
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)
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).
3. I let PowerApps do my work for me and autogenerated a PowerApp from List B
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.
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:
(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
Thank you again.
But as i said, i need to filter the managers based on the user selected.
Sharepoint list of Managers :
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.
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."
(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
User | Count |
---|---|
254 | |
101 | |
94 | |
47 | |
37 |