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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Irish Last Name with A...
Power Automate
Answered

Irish Last Name with Apostrophe causing flow to fail

(0) ShareShare
ReportReport
Posted on by

The RegistrantNameText is a string from 'x-ms-user-name-encoded'

This works perfectly until we have a name with an Apostrophe.

Error:

The expression "RegistrantNameText eq 'O'Bryan, Al' and Course_x0020_ID eq 67" is not valid. Creating query failed.
clientRequestId: 1bda0327-d87d-4938-ac42-1f9ec77b4014
serviceRequestId: 1bda0327-d87d-4938-ac42-1f9ec77b4014

var.jpg
Categories:
I have the same question (0)
  • Verified answer
    Expiscornovus Profile Picture
    33,406 Most Valuable Professional on at

    Hi @KassieH,

     

    I assume you have added it as expression to the RegistrantNameText string variable and not as plain text?

     

    And what trigger action are you using? I tested it with the Manually trigger a flow action. 

     

    username_apostrophe.png

  • KassieH Profile Picture
    on at

    That did not work.  It only imported the whole thing over in the string.

     

    The expression "RegistrantNameText eq 'replace(base64ToString(O'Bryan, Al), '''', '''''')' and Course_x0020_ID eq 67" is not valid. Creating query failed.
    clientRequestId: 854c96cb-29d4-4eaf-be8a-7c777be37fcd
    serviceRequestId: 854c96cb-29d4-4eaf-be8a-7c777be37fcd

  • Expiscornovus Profile Picture
    33,406 Most Valuable Professional on at

    Hi @KassieH,

     

    You need to escape that apostrophe by using another apostrophe. The below should be valid

    RegistrantNameText eq 'O''Bryan, Al' and Course_x0020_ID eq 67

     

    In your setup you could use the following expression in your variable:

    replace(base64ToString(triggerOutputs()['headers']['x-ms-user-name-encoded']), '''', '''''')

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 245 Super User 2025 Season 2

#2
Expiscornovus Profile Picture

Expiscornovus 207 Most Valuable Professional

#3
trice602 Profile Picture

trice602 190 Super User 2025 Season 2

Last 30 days Overall leaderboard