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 III
Super User III

@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

View solution in original post

3 REPLIES 3
RandyHayes
Super User III
Super User III

@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

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 III
Super User III

@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

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza Winner Announcement

Please join us on Wednesday, July 21st at 8a PDT. We will be announcing the Winners of the Demo Extravaganza!

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

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.

Top Solution Authors
Top Kudoed Authors
Users online (2,965)