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

Announcements

News and Announcements icon
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)
  • Expiscornovus Profile Picture
    33,768 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']), '''', '''''')

     

  • 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

  • Verified answer
    Expiscornovus Profile Picture
    33,768 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

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 262 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 227

#3
Expiscornovus Profile Picture

Expiscornovus 225 Most Valuable Professional

Last 30 days Overall leaderboard