web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id : qTLOKIj+QnlcAeVTZjywGJ
Power Automate - Building Flows
Unanswered

E-mail address with an apostrophe causing flow to fail

Like (2) ShareShare
ReportReport
Posted on 16 Jul 2024 19:14:00 by 85

Hi there,

 

I have a flow that gets information from a SharePoint list where I am managing an onboarding tracker.  The flow sends an individual email to each of the hiring managers once per week with status updates and it's been working fine.  Please see the flow below:

 

smodkins_0-1721156869674.png

smodkins_1-1721156906891.png

smodkins_2-1721156958118.png

 

This week it's been failing on one record though everyone elses appears to have been sent successfully and the only difference I can see is the manager has an email address with an apostrophe in it.

 

This is the step it's failing at and the error (with the email address changed for privacy)

 

smodkins_3-1721157078271.png

 

Action 'Get_items_Filtered_List' failed: The expression "(LineManager/EMail eq 'Edward.O'Callaghan@powerautomate.com') and ((Status eq '1. Welcome e-mail sent (candidate to complete backchecks)') or (Status eq '2. Candidate completing consent forms') or (Status eq '3. Candidate completed consent forms, checks in production') or (Status eq '4. Backchecks complete, awaiting start date') or (Status eq '5. Start date confirmed, awaiting induction')) and ((BusinessArea eq 'London') or (BusinessArea eq 'Leeds'))" is not valid. Creating query failed. 

 

Any help you can offer would be much appreciated 

I have the same question (0)
  • Chriddle Profile Picture
    8,030 Super User 2025 Season 2 on 21 Aug 2024 at 07:40:12
    E-mail address with an apostrophe causing flow to fail
    Here <email> is a placeholder for the email address.
    In your case probaply outputs('Compose_Email_To')
  • smodkins Profile Picture
    85 on 12 Aug 2024 at 19:55:26
    E-mail address with an apostrophe causing flow to fail
    Thank you Chriddle.  
     
    Do I leave the <email> in the expression just like that or do I need to replace with a field?
  • Chriddle Profile Picture
    8,030 Super User 2025 Season 2 on 12 Aug 2024 at 12:13:06
    E-mail address with an apostrophe causing flow to fail
    Replacing ' with %27 won't work., because you are checking for equality.
    You have to do a Power Automate encoding (which is 2 single quotes).
     
    This expression replaces one single quote with two single quotes in <email>:
    replace(<email>, '''', '''''')
  • smodkins Profile Picture
    85 on 10 Aug 2024 at 19:30:18
    E-mail address with an apostrophe causing flow to fail
    Hi trice602,
     
    Thank you for coming back to me! I saw you replied but have been unable to access this thread in the migration to the new experience but it is back now!
     
    Thank you for the suggestion.  Can you show me how this would look in a flow?  Apologies but I am still quite new to power automate 
     
    Thanks in advance
  • trice602 Profile Picture
    14,636 Super User 2025 Season 2 on 16 Jul 2024 at 19:54:07
    Re: E-mail address with an apostrophe causing flow to fail

    Hi @smodkins ,

     

    One way to help work with this name is to use a variable.  Then replace the apostrophe with a %27, such as:

    replace(triggerOutputs()?['body/FullName'],'''','%27')

     

    Then refer to the variable downstream.  This will help you with the apostrophe error you are getting.

     

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

MS.Ragavendar – Community Spotlight

We are honored to recognize Ragavendar Swaminatha Subramanian as our September…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 954 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 650 Moderator

#3
trice602 Profile Picture

trice602 327 Super User 2025 Season 2

Last 30 days Overall leaderboard
Loading complete