Showing results for 
Search instead for 
Did you mean: 
Regular Visitor

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?

Community Support
Community Support

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:




Best regards,



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.

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

UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,204)