Showing results for 
Search instead for 
Did you mean: 
New Member

Escape special characters when sending email

I am building a workflow to run on form submission, and I want the email body to have the form response data. I'm using the SendGrid connector to send the email.


However, there seem to be no functions for sanitising email addresses and escaping HTML. This means that if in my form, I ask for an email address, and I want my email to CC this address, they could put "," and it would end up having two emails CC'd in it.


They can also include custom HTML in any of the form responses and if I want to put these in the message body, anyone who responds would be able to insert whatever HTML they want...


Am I being thick, or is there really no sanitisation functions? This seems like a pretty big thing to be missing...

Super User
Super User

It's not missing, you need to add a compose action and use one or more replace functions in the expression. Have a look at


Los Gallardos
If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.

Thanks for the response, Rob!


I would say that this is still a missing feature since it has to be done manually. In my case, the form has about 20 fields. so this is horrendously messy; I'll hold off on doing this for now, if it is the only way.


It is slightly concerning that this isn't built in (or even the default), since Microsoft markets PowerAutomate as something for "everyone". I wouldn't expect someone with no programming background to even know that you need to sanitise inputs.

Helpful resources

Power Automate News & Announcements

Power Automate News & Announcements

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

Community Calls Conversations

Community Calls Conversations

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

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (6,020)