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.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
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.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

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

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.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
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
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,171)