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

Automatically adding multiple people to People Combobox

Hi all,

 

I'm having an issue with figuring out how to add multiple people automatically to a People column combobox.

 

I have a dropdown with different departments that has multiple choices enabled. When I select a department I'd like it to automatically populate the People combobox with that departments manager.

 

I've got it halfway there, when I select a department it does populate the combobox, but my issue is that when I select multiple departments it only adds in the last department chosen. For example, I select "IT" and it adds the IT manager, but when I also then select "HR", it overwrites the IT manager with the HR manager.

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@orbd 

What is the Items property of DataCardValue11 ?  That would be a good place to start to get things working easier.

 

As for your datasource...is Contact a person column?

 

If you want multiple selections, you need to supply a table.  You are currently supply a record.

So, this would give you what you want.

ForAll(DataCardValue11.SelectedItems,
    With({_item:LookUp(SeabeeManagement, Department=Value, Contact)},

        { 
          Claims:"i:0#.f|membership|" & Lower(Contact.Email), 
          Department:"", 
          DisplayName: Contact.DisplayName, 
          Email: Contact.Email, 
          JobTitle:".", 
          Picture:"."
        }
    )
)

 

However...if your Contact column IS a person column, then you only need this:

ForAll(DataCardValue11.SelectedItems,
    LookUp(SeabeeManagement, Department=Value, Contact)
)

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

3 REPLIES 3
RandyHayes
Super User
Super User

@orbd 

What is the Items property of DataCardValue11 ?  That would be a good place to start to get things working easier.

 

As for your datasource...is Contact a person column?

 

If you want multiple selections, you need to supply a table.  You are currently supply a record.

So, this would give you what you want.

ForAll(DataCardValue11.SelectedItems,
    With({_item:LookUp(SeabeeManagement, Department=Value, Contact)},

        { 
          Claims:"i:0#.f|membership|" & Lower(Contact.Email), 
          Department:"", 
          DisplayName: Contact.DisplayName, 
          Email: Contact.Email, 
          JobTitle:".", 
          Picture:"."
        }
    )
)

 

However...if your Contact column IS a person column, then you only need this:

ForAll(DataCardValue11.SelectedItems,
    LookUp(SeabeeManagement, Department=Value, Contact)
)

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

orbd
Frequent Visitor

Wow, thanks so much Randy. I've been pulling my hair out for the past couple days trying to figure this one out 🙂 

RandyHayes
Super User
Super User

@orbd 

No problem...always come to the forums when you get stuck. Answers are here! 😁

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Microsoft Ignite 768x460.png

Find your focus

Explore the latest tools,training sessions,technical expertise, networking and more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

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

Users online (2,583)