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

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
Makacska
Level: Powered On

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

XJDE2019
Level: Power Up

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
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,436)