cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Mareliese
Helper I
Helper I

Hide O365 Error Message with blank To field

Is there any a way to hide the following error message:

 

Office365Outlook.SendEmail failed: { "status": 400, "message": "Parameter 'To' cannot be null or empty.\r\nclientRequestId: cdb56a4a-1218-44f6-8d01-2969df19bd08", "error": { "message": "Parameter 'To' cannot be null or empty." }, "source": "office365-we.azconn-we-01.p.azurewebsites.net" }

 

It is a Lookup function of the email address linked to a user's name and when Saved the person receives the email. There are a few without email addresses which will and should not receive the mail. But they receive the error message when saved and moved to the next screen. 

2 ACCEPTED SOLUTIONS

Accepted Solutions
v-xiaochen-msft
Community Support
Community Support

Hi @Mareliese ,

 

According to your description, I think you could change the way.

You could try the If() function to determine whether the user has a mailbox.

If the user has a mailbox, use the function Office365Outlook.SendEmail().

If the user does not have a mailbox, the function Office365Outlook.SendEmail() will not be used.

 

You could refer to the following formula:

If(!IsBlank(***),Office365Outlook.SendEmail(***))

 

Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.

View solution in original post

hi @Mareliese 

 

Yuu are almost there ;), the Sendmail part requires an email, subject and body. all you have to do is add the subject and body. for this reason the error is revceived 1 (you have an email address), expects (Subject, Body).

 

hope it helps

 

View solution in original post

5 REPLIES 5
v-xiaochen-msft
Community Support
Community Support

Hi @Mareliese ,

 

According to your description, I think you could change the way.

You could try the If() function to determine whether the user has a mailbox.

If the user has a mailbox, use the function Office365Outlook.SendEmail().

If the user does not have a mailbox, the function Office365Outlook.SendEmail() will not be used.

 

You could refer to the following formula:

If(!IsBlank(***),Office365Outlook.SendEmail(***))

 

Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.

Thank you Wearsky. 

Clearly I'm still missing something / some understanding. 

I've amended the formula to: 

If(!IsBlank(DataCardValue_AuthorisedEmail.Text),Office365Outlook.SendEmail(DataCardValue_AuthorisedEmail.Text)),

But now I'm receiving the following error message: 

Invalid number of arguments: received 1, expected 3-4. 

What am I missing? 

Thank you 

hi @Mareliese 

 

Yuu are almost there ;), the Sendmail part requires an email, subject and body. all you have to do is add the subject and body. for this reason the error is revceived 1 (you have an email address), expects (Subject, Body).

 

hope it helps

 

Thank you Rubin. 

Your timing is perfect. I've just managed to sort the formula. 

The mail sends when there is an email address.

When no email address, there is no longer an error message. 

And the Apps moves to the next screen without any hiccups. 

Thank you. 

great stuff, enjoy the app.

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PWREduCon768x460.png

Join us at PWR EduCon - A Power Platform Conference

Learn from the top Power BI, Power Apps, Power Automate & Power Virtual Agents experts!

Top Solution Authors
Top Kudoed Authors
Users online (2,966)