<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Arvydas Laukūnas</title>
    <description>The latest articles on DEV Community by Arvydas Laukūnas (@laukunas).</description>
    <link>https://dev.to/laukunas</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4238385%2F37f5883c-77d9-4f0e-bd39-3fc6e16632c4.jpg</url>
      <title>DEV Community: Arvydas Laukūnas</title>
      <link>https://dev.to/laukunas</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/laukunas"/>
    <language>en</language>
    <item>
      <title>How to escape single quote in OData filter</title>
      <dc:creator>Arvydas Laukūnas</dc:creator>
      <pubDate>Wed, 11 Nov 2026 06:02:56 +0000</pubDate>
      <link>https://dev.to/laukunas/how-to-escape-single-quote-in-odata-filter-4j5c</link>
      <guid>https://dev.to/laukunas/how-to-escape-single-quote-in-odata-filter-4j5c</guid>
      <description>&lt;p&gt;Imagine you run an agency for temp employees and dozens of new people want to work a few extra hours a week so they can finally buy a decent Christmas present for their loved ones.&lt;/p&gt;

&lt;p&gt;Since you cannot find an intern to take all those calls and get all those personal details of each candidate, you decide to create a Microsoft form that should be submitted by each candidate. And since you are not afraid of technology, you create a new SharePoint list and a simple Power Automate Flow that creates a new list item as soon as the form is filled so you have all the details you need in one place.&lt;/p&gt;

&lt;p&gt;And your agency is successful – the list fills up quickly, you have a lot of temp workers at your disposal, companies are happy to do business with you.&lt;/p&gt;

&lt;p&gt;But then you notice that the name of a new candidate who just filled in the form is familiar. You look it up in your list and realize that that person already has two other entries.&lt;/p&gt;

&lt;p&gt;You Google around for a bit and you stumble upon OData filters. So you add “Get items” action to your flow with OData filter that finds potential duplicate entries – when the form is submitted, the flow now checks if a person in the SharePoint list already exists by trying to get items with the same email address, phone number and the combination of name and surname. It looks something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;(Name eq '@{outputs('Get_item')?['body/Name']}' 
and 
Surname eq '@{outputs('Get_item')?['body/Surname']}')
or
(Email eq '@{outputs('Get_item')?['body/Email']}') 
or
(Phone eq '@{outputs('Get_item')?['body/Phone']}')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If “Get items” action returns something, you still create a new item, but now you also send an email to yourself with details of previous items. This solution does the job – it reports potential duplicates, you review them and delete them when needed. Life returns back to normal and somehow your coffee tastes better once again.&lt;/p&gt;

&lt;p&gt;But then something happens. An angry person called in and said he never heard from you despite filling out the form a billion times!&lt;/p&gt;

&lt;p&gt;You checked the flow results and found that there were fewer than a billion (you cannot believe he lied) failed flows. You check and you see that the OData filter failed. It seems the flow for some reason hates Sean O’Brien as all other flow runs are fine.&lt;/p&gt;

&lt;p&gt;Then you realize, maybe it’s not Irishmen that your flow hates. Maybe it’s the single quote. You Google around once again but now it takes a bit longer as most suggestions do not work. But you are relentless and you browse until you find something that works! You finally find this expression:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;replace(body('Get_item')?['Surname'], '''', '''''')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You updated your OData filter and by doing so you welcomed another nation into your home. Life is good again.&lt;/p&gt;

</description>
      <category>powerplatform</category>
      <category>powerautomate</category>
    </item>
  </channel>
</rss>
