Skip to main content

Notifications

Power Automate - General Discussion
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

  • Verified answer
    Expiscornovus Profile Picture
    Expiscornovus 31,139 on at
    Re: Irish Last Name with Apostrophe causing flow to fail

    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
    KassieH on at
    Re: Irish Last Name with Apostrophe causing flow to fail

    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
    Expiscornovus 31,139 on at
    Re: Irish Last Name with Apostrophe causing flow to fail

    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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,567

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,907

Leaderboard