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

Office365Outlook.SendEmail 'To' parameter from Concat() function

Hello all,

 

I'm having an issue with the SendMail function in my PowerApps app linked to 2 SharePoint Lists (1 is irrelevant here).

 

As you can see on the 1st image, I have a SharePoint List named "Dépôt commande e-mails" where I have the full names and Office360 Outlook emails of my colleagues.

 

The app itself is a form, and when someone submits the form, it is supposed to send an email to everyone in the SharePoint list of emails. In the OnSuccess of the form, you can see the full formula on the second image.

 

What I'm struggling with here is, as better seen on the third image, I used a Concat() function to get all the emails of the SharePoint list as a string, separated each by ", " (comma + space) as the "To" parameter of the mail.

 

While it was working perfectly fine with me, when someone with a different mail than the ones in the list used the app and submitted their form it displayed an error message saying that the "To" parameter of the email (so the Con

cat() function) isn't valid.

 

Why does this happen to other users except the ones in the list ? Am I doing something wrong ?

 

Thanks,

Raph1

1 ACCEPTED SOLUTION

Accepted Solutions

Error fixed, it was due to me not giving everyone the perms in the email SharePoint list

 

Thanks anyways

Raph1

View solution in original post

7 REPLIES 7
cmyoung07
Resolver I
Resolver I

Wonder if this has to do with the comma separated email addresses, not sure if it this a cultural/regional setting. I always use a semicolon which I believe is the default separator for Outlook (which can be changed in Outlook to commas). Try changing your separator to semicolon and see if that works for both you and the other user.

Will do, I'll keep you updated if it resolved the problem.

It has nothing to do with the comma unfortunately. I don't think the problem lies in the format of the function...

cmyoung07
Resolver I
Resolver I

The error message does indicate is has something to do with what is being passed to the <To> Parameter, can you put the results of what is getting passed to that field in a label so you can see the value and post a screen shot of that?

Here, this is why I don't see the error 

 

Raph1_1-1666277894827.png

 

Error fixed, it was due to me not giving everyone the perms in the email SharePoint list

 

Thanks anyways

Raph1

cmyoung07
Resolver I
Resolver I

Glad to hear it, makes sense as they were getting no items returned and the 'To' parameter was blank causing the error, would have been nice to have an access denied message, would have been a little easier for you to find the issue.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,920)