cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SdR1
Level: Powered On

Office365.SendEmail' has an invalid value for parameter 'To

I receive this message "Office365.SendEmail' has an invalid value for parameter 'To" because I am using at OnSelect;

 

Office365.SendEmail(Gallery1.Selected.'E-Mail',"Thank you for visiting" , "You have been de-registered")

 

But not everyone fills in the e-mail field: Gallery1.Selected.'E-Mail' which causes the error.

 

How can I prevent the error without making the field a mandatory field?

2 REPLIES 2
Community Support Team
Community Support Team

Re: Office365.SendEmail' has an invalid value for parameter 'To

Hi @SdR1,

 

An error message would be returned whenever a required parameter is blank in the function.

Please take a try with the following code which will send out the email without issues:

Add a button under the gallery and set its OnSelect property:

If(IsBlank(BrowseGallery1.Selected.EmployeeName.Email),"",Office365.SendEmail(BrowseGallery1.Selected.EmployeeName.Email,"test","details"))

 1.PNG

 

Best regards,

Mabel

 

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
SdR1
Level: Powered On

Re: Office365.SendEmail' has an invalid value for parameter 'To

Hi @v-yamao-msft

 

Did what you suggested and now have in the OnSelect of the Button;

 

If(IsBlank(Gallery1.Selected.'E-Mail'),"",Office365.SendEmail(Gallery1.Selected.'E-Mail',"Thank you for visiting" , "You have been de-registered"))

 

But I still receive the same error message.

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

Follow PowerApps on Twitter

Stay Up-to-Date by following PowerApps on Twitter

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

Users Online
Currently online: 53 members 3,870 guests
Please welcome our newest community members: