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
Solved! Go to Solution.
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)
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
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:
Method2:
Hope this can be helpful.
Best Regards.
Yumia
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)
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
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:
Method2:
Hope this can be helpful.
Best Regards.
Yumia