cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Advocate V
Advocate V

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

Hi Tom,

 

Sure, I'd be glad to. It does look like private messaging is possible with the platform. Just let me know if you do have such a need and I'll share my code with you.

 

Dave

Highlighted
Advocate I
Advocate I

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

Hello tomgardzinski

Did you try to use dynamic value (variable ) at the 'To' param of Office365.SendEmail function?

Please check if valid value is sent to there

 

In my case I have got the same error

I have tried to use it after submitting a form.

I've used the Form1.Lastsubmit.'Email Address' at the 'To' param, but after a short investigation I have found that the Form1.Lastsubmit did not work at all. Did not matter if I used it on OnSuccess property of Form or directly on Submit button. So there was no valid value to put in to the 'To' param due to Form.lastsubmit failure

 

The following workaround worked:

In the form I have created string variable on the Onchange property of according Textinput (=DataCardValueX) controller.

I have put the string variable to the 'To' param, and Office365.SendEmail worked this way.

So in my case the form.lastsubmit failed, not the Office365.SendEmail function

Highlighted
New Member

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

Ok try this. I managed to fix my issue by looking at the value being taken from the query. In this case on the OnSelect Function being Office365.SendEmail(DataCardValue1.Selected.Email, "Subject", "Body", {Importance:"Normal",IsHtml:false})
 
So it turns out it the data fields themselves. Create a Label in the TEXT Property in the FX line at the top remove the "Text" pop in the datacardvalue i.e. in this example here. DataCardValue1.Selected.Email
Now see if the label updates with the email address you want it to go to i.e. the Value of the Name of the DatacardValue. 
 
If it does show you the email > then the datacardvalue display field is pointing to the RIGHT place. So it might be an issue with the connector. Be aware of any organistations that ask for Multi Factor Authentication as this has usually a 7 day lease on these things (if you aren't using a gateway). This might be doing it go to your connections bin them and readd them. 
 
If it does not show a Value, then the datacardvalue display field is pointing to the WRONG place. To fix it go to the DataCardValue itself within the DataCard tree and go to the Advanced Properties . Unlock the property if it is locked. Go to DATA | DisplayFields and if this is a People Lookup/Group Lookup from SharePoint or Excel simply go in and change the Value to ["Email"] (this syntax is the way to do it including the square brackets. 
 
Do your test with the Label like above again and it should show the value now in plain text. Redo the OnSelect Function like this Office365.SendEmail(DataCardValue1.Selected.Email, "Subject", "Body", {Importance:"Normal",IsHtml:false}) and give it try. 
 
Hope this helps! Smiley Happy

Helpful resources

Announcements
Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

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