Skip to main content

Notifications

Community site session details

Community site session details

Session Id : tFO3+Js88RZZMRHQZwmTKi
Power Apps - Building Power Apps
Answered

Display plain text email addresses from selections in people picker

Like (0) ShareShare
ReportReport
Posted on 16 Jun 2021 14:30:03 by 588

My app allows a manager to assign a ticket to multiple staff members using a people picker, however, we want to be able to store the assigned staff member's email addresses in a plain text string in order for it to work well with a couple of flows we run later down the line. 

 

I had tried to create a collection OnChange and then concat the email columns of the collection but have been having trouble with removing items from the collection if they are removed from the people picker, or if a second staff member is assigned in a different session than the first, then the first appeared to drop off the collection too. 

 

I also had a problem that I had set a 'DefaultSelectedItems' to the assigned user in certain situations eg. a certain task is selected therefore it is automatically assigned to the expert in that field, but the defaultselecteditems property didn't seem to trigger the OnChange meaning the email address was not added to the collection/string.

 

Is there any way to collect the email addresses from the people picker both on a manual change and a default selection?

 

At the moment I have changed the dropdown to a basic combobox where the manager just picks out email addresses from the list, but I find it much more aesthetic and user friendly to choose/display names rather than emails!

 

Any help is appreciated.

 

Categories:
  • not_a_thing Profile Picture
    65 on 22 Jun 2021 at 10:07:18
    Re: Display plain text email addresses from selections in people picker

    Glad we managed to lead you to the solution together with @zmansuri 🙂

    Have a good day

  • misc Profile Picture
    588 on 21 Jun 2021 at 12:59:58
    Re: Display plain text email addresses from selections in people picker

    I'm not sure actually...though I had it working previously and I was sure I used Email then so I had assumed that wasn't the problem.

     

    I managed to use this code in the plaintext label in the end and it is working fine. I think this is what Zmansuri had meant in the first place but I hadn't understood properly.

    Concat(DataCardValue10.SelectedItems, Email, "; ") & Label11.Text

     

  • not_a_thing Profile Picture
    65 on 17 Jun 2021 at 10:26:10
    Re: Display plain text email addresses from selections in people picker

    Your ClearCollect function assigns

    Name: DisplayName
    EmailAddress: Email

    but the initial list in the taskdpd only has those fields: @Anonymous.type, Claims, DisplayName

     

    Naturally, in the collection you have values for DisplayName, but not the e-mails, since there's no Email field, or?..

  • misc Profile Picture
    588 on 17 Jun 2021 at 10:12:27
    Re: Display plain text email addresses from selections in people picker

    Thanks for your response. I have gone back and tried to do this today but my collection does not seem to be getting the email address at all now?

     

    Code of taskdpd is:

    ClearCollect(Assigned, {Name: DataCardValue10.SelectedItems.DisplayName, EmailAddress: DataCardValue10.SelectedItems.Email})

     DataCardValue10 is the peoplepicker which has the default:

    datacardvalue10.png

     

    And my collection ends up looking like this:

    assigned.png

     

    The DataCard TicketAssignedToName I have tried both:

     

    Concat(Assigned.EmailAddress, "; ")

    and as you suggested:

    Concat(DataCardValue10.SelectedItems, Email, "; ")

    The former ends up just showing the semi-colon and the latter returns empty. It just seems Email isn't collecting at all?

     

    Not sure what I'm doing wrong here! 

  • Verified answer
    zmansuri Profile Picture
    6,048 Super User 2024 Season 1 on 16 Jun 2021 at 14:40:31
    Re: Display plain text email addresses from selections in people picker

    a13.jpg

  • CNT Profile Picture
    10,919 Super User 2025 Season 1 on 16 Jun 2021 at 14:38:11
    Re: Display plain text email addresses from selections in people picker

    @misc For the purpose of easily adding and removing from the Collection, it would be better to store the emails as separate records without concatenating them. You can always concatenate them before sending it to a Flow.

    OnChange  will get triggered only when a change is manually made (In some strange occasions it does get triggered when the Default value changes but it is not designed to work like that. So, don't rely on that).

    To add the email based on some other change you can add it to the collection in the same place where the other change is made.  

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,731 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,077 Most Valuable Professional

Leaderboard
Loading started