cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
abd3127
Level 8

Populating table with direct reportees of a user using office 365 connector

Hello Team,

I am creating a app where i have a dropdown in which we can select a person. (Suppose Manager)

After this, i have a gallery in which i have used combobox to select persons.

So the condition here is that whichever manager (user) i have selected in the dropdown, his direct reportees should be populated in this gallery and populate the combo-boxes.

 

I am unable to form the logic here. 

Please suggest some ideas.

 

Thanks

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Community Support Team
Community Support Team

Re: Populating table with direct reportees of a user using office 365 connector

Hi @abd3127 ,

Could you please share a bit more about the formula you typed within the Items property of the Manager Dropdown box?

 

Based on the needs that you mentioned, I have made a test on my side, please take a try with the following workaround:4.JPG

 

5.JPG

 

6.JPG

Set the Items property of the Dropdown control (Dropdown1) to following:

Filter(Office365Users.SearchUser(), !IsEmpty(Office365Users.DirectReports(Id)))   /* <-- Filter all managers in your Office 365 Org */

Set the Items property of the Gallery to following:

Office365Users.DirectReports(Dropdown1.Selected.Id)

then within your Gallery, add some Label controls to display the related user info using the following formula:

ThisItem.DisplayName
ThisItem.Id

...

Set the Items property of the ComboBox to following:

Office365Users.DirectReports(Dropdown1.Selected.Id)

Please take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Community Support Team
Community Support Team

Re: Populating table with direct reportees of a user using office 365 connector

Hi @abd3127 ,

Based on the needs that you mentioned, I think the SearchText property of the ComboBox control could achieve your needs.

 

I have made a test on my side, please take a try with the following workaround:1.JPG

Set the IsSearchable property of the ComboBox to following:

true

Set the Items property of the ComboBox to following:

If(
    IsBlank(ComboBox1.SearchText),
    Office365Users.DirectReports(User().Email),
    Office365Users.SearchUser({searchTerm:ComboBox1.SearchText})
)

On your side, you should type:

If(
    IsBlank(ComboBox1.SearchText),
    Office365Users.DirectReports(Gallery2_4.Selected.Id),
    Office365Users.SearchUser({searchTerm: ComboBox1.SearchText})
)

Note: The ComboBox1 represents the ComboBox control within your Gallery. In default, the ComboBox would be populated with direct reports under selected Manager. If you want to add extra emebers, you could type the memeber name manually within the ComboBox to search the related users.

 

Please take a try with above solution, check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
4 REPLIES 4
Super User
Super User

Re: Populating table with direct reportees of a user using office 365 connector

Basically what you need is to use the Office 365 Users connection and the DirectReports(ManagerUPN) method to get the list of direct reports to set the Items property of the gallery.  Then just map the individual values to the gallery.

 

But I'm not sure what you are doing with the Combo box? The Gallery itself will be bound to multiple records. If you put a Combo box inside the Gallery then it can be bound to multiple items for each record in the gallery. So what is the relationship here?  manager -> many direct reports -> many what in the combo box? The combo box seems redundant.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Community Support Team
Community Support Team

Re: Populating table with direct reportees of a user using office 365 connector

Hi @abd3127 ,

Could you please share a bit more about the formula you typed within the Items property of the Manager Dropdown box?

 

Based on the needs that you mentioned, I have made a test on my side, please take a try with the following workaround:4.JPG

 

5.JPG

 

6.JPG

Set the Items property of the Dropdown control (Dropdown1) to following:

Filter(Office365Users.SearchUser(), !IsEmpty(Office365Users.DirectReports(Id)))   /* <-- Filter all managers in your Office 365 Org */

Set the Items property of the Gallery to following:

Office365Users.DirectReports(Dropdown1.Selected.Id)

then within your Gallery, add some Label controls to display the related user info using the following formula:

ThisItem.DisplayName
ThisItem.Id

...

Set the Items property of the ComboBox to following:

Office365Users.DirectReports(Dropdown1.Selected.Id)

Please take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
abd3127
Level 8

Re: Populating table with direct reportees of a user using office 365 connector

Hi @v-xida-msft 

The solution you provided works exactly like i wanted.

I have used a combobox(person view) which populates the direct reportees inside the gallery.

Now here one more question is : I can not add any other employees data other than the Direct Reports.

We used

Office365Users.DirectReports(Gallery2_4.Selected.Id)

Which provided us only directs. Is there any way via which i can also select the employees those are not under the selected teamlead?

 

This is because i only want combobx to show direct reportees under teamlead, but have a ability via which we can add extra members also.

 

 

 

Community Support Team
Community Support Team

Re: Populating table with direct reportees of a user using office 365 connector

Hi @abd3127 ,

Based on the needs that you mentioned, I think the SearchText property of the ComboBox control could achieve your needs.

 

I have made a test on my side, please take a try with the following workaround:1.JPG

Set the IsSearchable property of the ComboBox to following:

true

Set the Items property of the ComboBox to following:

If(
    IsBlank(ComboBox1.SearchText),
    Office365Users.DirectReports(User().Email),
    Office365Users.SearchUser({searchTerm:ComboBox1.SearchText})
)

On your side, you should type:

If(
    IsBlank(ComboBox1.SearchText),
    Office365Users.DirectReports(Gallery2_4.Selected.Id),
    Office365Users.SearchUser({searchTerm: ComboBox1.SearchText})
)

Note: The ComboBox1 represents the ComboBox control within your Gallery. In default, the ComboBox would be populated with direct reports under selected Manager. If you want to add extra emebers, you could type the memeber name manually within the ComboBox to search the related users.

 

Please take a try with above solution, check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
SecondImage

Join our Live PowerApps Webinar

Tomorrow, September 24st at 10am PDT

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

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

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Users Online
Currently online: 330 members 4,907 guests
Please welcome our newest community members: