web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Populating email addre...
Power Apps
Unanswered

Populating email addresses from a drop down with user name selected

(0) ShareShare
ReportReport
Posted on by 274

Hi PowerApp users,

i have 2 list.

Config list (EmailAddressList) have one item with a Persons field having multiple users.

another main list where Powerapps form is used.

I need to populate the Fullnames of users in a dropdown in the main list. So, i have used a collection on the visible property of the form-

Clear(PersonNames);Collect(PersonNames,ForAll(First(EmailAddressList).Persons,DisplayName))

And on the dropdown field (dropdown1), populated the display names using the above collection-

Items=PersonNames

Now, i want to get the equivalent email address of the person selected in the dropdown, i tried something like this-

 

ForAll(First(EmailAddressList).Persons,If(Dropdown1.Selected.Value=DisplayName,Email))

But this populates a dropdown even with blank values.

Attached a screenshot- 1st dropdown populates the user name (working as expected)

2nd dropdown (icould be happier if its just a text box) populating the email address of the user selected from 1st with black values as well.

How can i get just the email address.

Any help appreciated.

Regards,

Kevin

 

 

 

Categories:
I have the same question (0)
  • Verified answer
    v-yuxima-msft Profile Picture
    on at

    Hi @kevingeorget,

     

    What data source do you use?Is it SP list?

    Is Persons one Person or Group type? If you want to use the Email base on the DisplayName , firstly,you should make sure the  users must be the ones in your group.

    And use the formula expression you provide to create cascading dropdown, there is no issue to create cascading dropdowns on my side.

    Could you please create one new to test again?If that is not Ok. You can try the following expression as:

    Button.OnSelect: ClearCollect(Personstest,First('20190214EmailAddressList').Persons)   (you can use your collection name and list name to instead of “Persontest”,”20190214 EmailAddressList”)

    Dropdown1.Items: Personstest.DisplayName  (displayname dropdown)

    Dropdown2.Items: Sort(Distinct(Filter(Personstest, DisplayName=Dropdown6.Selected.Value), Email), Result) (email dropdown)

    And do you want to the Email will be auto filled in one text box?

    If you want to it is auto filled based on the first dropdown select display name, you need to create one new Email collection as the first one you do if you use forall formula expression.

     

    I test as next:

    Data Source:20190214EmailAddressList(my SP list name)

    Persons(People or Group type, allow multiple selections)

    EmailAdreesListDATASOURCE1.jpg

    App Test:

    Method1: use forall formula expression

    Add one button and two dropdown controls and one label control.

    Button.OnSelect: ClearCollect(PersonNames,ForAll(First('20190214EmailAddressList').Persons,DisplayName));ClearCollect(PersonEmail,ForAll(First('20190214EmailAddressList').Persons,Email))

    Dropdown_DisplayName.Items: PersonNames.Value

    Dropdown_Email.Items: ForAll(First('20190214EmailAddressList').Persons,If(Dropdown_DisplayName.Selected.Value=DisplayName,Email))

    Label.Text: LookUp(PersonEmail,Value=Dropdown_Email.Selected.Value).Value

    EmailAdreesListApptest1.jpg

    Mehtod2:

    Button5.Onselect: ClearCollect(Personstest,First('20190214EmailAddressList').Persons)

    Dropdown6.Items: Personstest.DisplayName

    Dropdown7.Items: Sort(Distinct(Filter(Personstest, DisplayName=Dropdown6.Selected.Value), Email), Result)

    Label.2.Text: LookUp(Personstest,Email=Dropdown7.Selected.Value).Email

     

     

     

    Result:

    Mehtod1:

    EmailAdreesListResultmethod1.1.jpg

    EmailAdreesListResultmethod1.2.jpg

     

    Method2:

    EmailAdreesListResultmethod2.1.jpg

     

    Hope this can be helpful.

    Best Regards.

    Yumia

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard