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 / Comment out single quo...
Power Automate
Unanswered

Comment out single quote in OData Filter Query with dynamic content

(0) ShareShare
ReportReport
Posted on by 209

Hello,

 

I have two lists. When an item is created in List 1, which includes a Name column, the flow looks at a Lookup list (List 2) to see if that name already exists. I am using a Get Items action with an OData Filter query in place to look at just the name column. The query:

2020-03-26_11-45-19.jpg

 

 

The issue I am having is that if there is a single quote in the person's name (e.g., Kevin O'Leary), the flow fails with the below error.

error.jpg

 

How would I go about commenting out a single quote in a name field when dynamic content is being used? I've searched online but not finding a solution.

 

Thank you in advance for your help!

M

Categories:
I have the same question (0)
  • Jcook Profile Picture
    7,781 Most Valuable Professional on at

    Hello @Morghan 

     

    You will have to sanitize the name by using the replace() expression:

     

    For example:

    See Compose firstname & Sanitize firstnameSee Compose firstname & Sanitize firstname

     

    The replace function is:

    replace(outputs('Compose_firstName'),'''',' ')

     

     

    —Josh
    If you like my post please hit the "Thumbs Up" -- If my post solved your issue please "Mark as a Solution" to help others

     

  • Morghan Profile Picture
    209 on at

    Hi @Jcook - thank you for the response! 

     

    Your suggestion is working, but running into a new issue now....

     

    Regarding your response, the Compose actions work but I had to change my Filter Query in the Get Items to the following -

    05.jpg

     

     

    The flow is completing successfully, however, the Condition that follows is now always resolving to false. Because now it's looking at the lookup list for "Kevin O Leary" instead of "Kevin O'Leary"  and never finds it, because the Create Item action is adding what the user entered into the New Hire Name column. What would the syntax be to have the Filter Query look for both the Output from the Sanitizing as well as what was entered into the "New Hire Name" column? 

     

     

  • Jcook Profile Picture
    7,781 Most Valuable Professional on at

    Hi @Morghan 

    My apologies,

     

    This will work, I tested on a Array I created with the name Kevin O'Leare.

     

    I am basically adding each existing name to an array, than checking the new hire if they exist in this array. Thus by passing the filter all together.

     

    Please try:

    pic1.png

     

    pic2.png

     

     

    —Josh
    If you like my post please hit the "Thumbs Up" -- If my post solved your issue please "Mark as a Solution" to help others

  • v-alzhan-msft Profile Picture
    on at

    Hi @Morghan ,

     

    I have made a test on my side and the issue is confirmed on my side.

    I would suggest that you could Take a try the Filter Array action to filter the items and it is works:

    1.png

     

    Best regards,

    Alice       

     

    Community Support Team _ Alice Zhang
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

  • Morghan Profile Picture
    209 on at

    Hi @Jcook - I'm sorry, I have not used arrays before and am going through your steps but not seeing the Output as an option in the below from your post (sorry it's so zoomed out, it was the only way to fit in one screenshot) -

     

    output.jpg

  • Jcook Profile Picture
    7,781 Most Valuable Professional on at

    Hi @Morghan 

     

    As I mentioned in my post. I am using Outputs but for you switch that to your triggers output.

     

    I am using outputs because I did not have a SharePoint trigger in my flow.

     

     

    Try putting the "Needed per..." dynamic content from your picture

     

    —Josh
    If you like my post please hit the "Thumbs Up" -- If my post solved your issue please "Mark as a Solution" to help others

     

  • Morghan Profile Picture
    209 on at

    Hi @Jcook - thank you for your patience. Got it, choosing the "Needed Peripherals" column from my trigger looked to have worked, thank you. I was confused by that being the only column available from my trigger action - I was expecting to see the "New Hire Name" as an option. When I run the test now, it always resolves to Condition = true. I think perhaps because I need to move my already existing Conditions up into the new condition we added, then move the "If Yes" and "If No" actions up, correct?-

     

    2020-03-30_15-54-06.jpg

  • Jcook Profile Picture
    7,781 Most Valuable Professional on at
    Hi @Morghan

    Yes, so move your condition up into the loop. Than make your condition:
    Choose the array on the left side
    Contains
    The right side you should be able to choose the name now like you expect.

    —Josh
    If you like my post please hit the "Thumbs Up" -- If my post solved your issue please "Mark as a Solution" to help others
  • Verified answer
    Jcook Profile Picture
    7,781 Most Valuable Professional on at

    @Morghan 

     

    I have replicated your flow as best as I could.

     

    Please try this:

     

    New1.png

     

    FullName is the names that already exist in the Lookup listFullName is the names that already exist in the Lookup list

     

    New3.png

     

    —Josh
    If you like my post please hit the "Thumbs Up" -- If my post solved your issue please "Mark as a Solution" to help others

  • Morghan Profile Picture
    209 on at

    Hi @Jcook - that did the trick!! I was also able to conceptually grasp your last suggestion the most, so thank you for helping me learn! You rock. 

     

    Thanks again,

    M

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
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard