
Hello,
I'm creating an app and there is a error I can't manage to solve.
What I want to do :
I have a sharepoint list with a person/group column where there is office mails in it. I would like to have a combobox control that takes for DefaultSelectedItems the people from the the person/group column of the first line of the sharepoint list. Then I would like to send a mail to these selected people.
I put this code for the combobox DefaultSelectedItems:
LookUp('splist';name= Dropdown2.SelectedText.Value;peopleColumn)
For items :
For Displayfields : ["DisplayName";"Mail"] and for searshfields : ["DisplayName"].
The people appear well on the combobox selection !
The error :
When I try to send the mail, I have this error :
From what I understand, the combobox is empty and there is no email selected. When I select a new mail adress, then it works fine...
Do you know how I can manage to solve this error ?
The code to send the mail :
Office365Outlook.SendEmailV2(
Concat(ComboBox1_4.SelectedItems; Mail&";");
TextInput2_2.Text;
"Bonjour,"
Thank you for your help !
Best regards,
Emeric
Hi @EmericTms ,
You issue is that there is a difference in the structure of your Person Field and the Combo Box Items - where Email (in the field) is called Mail. So your DefaultSelectedItems
With(
{
_Data:
LookUp(
'splist';
name = Dropdown2.SelectedText.Value
).peopleColumn
};
{
DisplayName: _Data.DisplayName;
Mail: _Data.Email
}
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
MVP (Business Applications) Visit my blog Practical Power Apps