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

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

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

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 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

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

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

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.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (1,159)