cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Priyasantra
Microsoft
Microsoft

How to send an email to the Person or group feild.

I have multiple person or group  field in an application as follows:

 

Employee details

Manager details

Trainer details. 

 In this i wanted to send an email to the field "Employee details" Currently I m using the Onselect property of a a submit button a form to Office365Outlook.SendEmail(sharepoint name. Employee details.Email, "Subject", Hi "& sharepoint name. Employee details.displayname&" Welcome onboard"). But this is giving me some error. can you help me to correct this and help me to use a send email function based on the employee details feild and also in the body in the opening of the email it must include the Display name of the employee details. 

 

Thanks

Priya

17 REPLIES 17
VijayTailor
Resident Rockstar
Resident Rockstar

Hi @Priyasantra ,
Please try to check like below.

//if People User Field Allow multi select Option.
Office365Outlook.SendEmailV2(First(ThisItem.Candidate.Email).Email,"Send mail through Gallery Icon Button","Hi"&Text(First(ThisItem.Candidate.DisplayName).DisplayName));

//If peope Field allow only single value selection.
Office365Outlook.SendEmailV2(ThisItem.MyUser.Email,"Send mail through Gallery Icon Button","Hi"&ThisItem.MyUser.DisplayName&"Rest og the Body content goes here");

VijayTailor_0-1601833452401.png

 

Thanks,
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."



mdevaney
Super User
Super User

@Priyasantra 

What error message are you receiving?  This info is usually important to solving the problem.  Suggest you share it here.

 

In the meantime I would suggest you try using SendMailV2 instead.  Let me know if this works.

 

Office365Outlook.SendEmailV2(
    'sharepoint name'. 'Employee details'.Email,
    "Subject",
    Hi "& 'sharepoint name'. 'Employee details'.DisplayName&" Welcome onboard"
)

 

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up." 

Hi @mdevaney  I have tried this but it gives an error as follows

 

Priyasantra_1-1601895525101.png

 

It tells your function sendemail has invalid arguments

 

My requirement is when i click the submit button it should send out an email to the "Employee details" and also the opening of the email must have the display name of the employee in the email body as follows 

 

Priyasantra_2-1601895697360.png

Please assist

Regards

Priya

Hi @VijayTailor 

 

I have tried your method but your method doesn't have an option to select Thisitem itself. It says the same error. Also if I type manually it gives me the error as invalid arguments

 

Priyasantra_0-1601895813873.png

 

Can you help me with something else?

Regards

Priya

@Priyasantra 

Your problem is with this code.  It doesn't actually generate an email.  Replace it with some code that does or hardcode your own email as a test.

 

 

'sharepoint name'. 'Employee details'.Email

 

 

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

 

Hi @Priyasantra ,

Collect the Data using variable and Instead of  Thisitem you can use varName.Email like that.
if your doubt still not clarified then, please describe here How you getting data you showing in the Form / Inputs that you mentioned in Screenshot.


Thanks,


Hi @mdevaney 

 

Can you explain me what do you mean by hardcode? I am very sorry but I am very new to powerapp.

Hi @VijayTailor @mdevaney 

 

Even this did not work. 

 

The concept is very simple. I am creating an onboarding application. So in this My requirement is for the first form. I have a form as shown in the below screenshot. and a submit button associated with this form. All I wanted to to do is when I click on submit button it should submit the form and sends out the email to the "Employee details". Employee details is a person and a group feild. The data source is a sharepoint list. And the other connectors I am using are "Outlook365users" and "Office365 users"

 

Priyasantra_0-1601906507115.png

 

Your help is much appreciated.

 

Regards

Priya

Hi @Priyasantra ,

As i understood , you are using the form and on Submit on Form, you are trying to sending mail.
Please see the below demo how you collect email and send email to the Selected user in the people or group field.

Due to size constrain uploading into Zip File.

have a look into that, Hope your Issue reslove
 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (5,455)