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 / How to escape the Sing...
Power Automate
Answered

How to escape the Single quotation in the filter query

(0) ShareShare
ReportReport
Posted on by 106
I made a flow about creating and updating Excel data to sharepoint list.
I used 「control 」action, and used「title」column as the key.
If the title have already been copied to the sharepoint list, the corresponding data would be updated by excel data.
If the title doesn't exist in the  sharepoint list, the data would be copied from excel to sharepoint list.
 
All things went successfully, except that I found there are some single quotation mark in the title column, which made the filter query in the condition action failed.
The query is title eq 'dynamic contents'
Ex. apple'company
which make the query become title eq 'apple'company 1Q' and failed.
 
Sorry,  for the Japanese. I translated the action name to English below. You can compare the name below with the capture I post above. I put the Japanese translation just after actions' English names.
manually trigger → variable(変数を初期化する) →do until→ list rows present in a table(表内に存在する行を一覧表示)→apply to each→get items(複数の項目の取得)→control  (条件)
  ∟ true → [create item](項目の作成)
  ∟ false  →for each → [update item](項目の更新)
→increment variable(変数の値を増やす)

list rows present in a table」can not get data from excel more than 256 rows, so I'm using [do until] to get data more than 256 rows.
 
The parameter in actions↓
manually trigger : the type of user input →number
variable : name→count    type→integer   value→0
do until:  loop stop condition →  variable('count')  is equal to  triggerBody()?['number']
list rows present in a table(get the data from excel):   skip count → variable('count')   datetime format→ ISO 8601
apply to each :  outputs('list rows present in a table')?['body/value']
get items(get the data from sharepoint): filter query→title eq 'title' top count→1
control  : condition expression →empty(outputs('get items')?[''body/value']) is equal to true
   ∟ true → [create item]
   ∟ false →[update item]
 
increment variable:  name→count   value→1
Categories:
I have the same question (0)
  • Verified answer
    stampcoin Profile Picture
    5,058 Super User 2025 Season 2 on at
    Single quotation marks (') in OData queries must be escaped by doubling them ('').
     
    Inside your "Get items" action, try this :
    title eq '@{replace(items('Apply_to_each')?['Title'],'''','''''')}'
    
    Please Make sure your dynamic content path (items('Apply_to_each')?['Title']) matches your exact data structure
  • Verified answer
    Riyaz_riz11 Profile Picture
    3,893 Super User 2025 Season 2 on at
    Hi,
     

    Updated Expression

    Suppose you're using the Excel title value like:

     
    title eq '@{items('Apply_to_each')?['Title']}'

    Update this to:

     
    title eq '@{replace(items('Apply_to_each')?['Title'], '''', '''''')}'
     

    Yes — it's 5 single quotes inside each '':

    • First pair: Power Automate string literal

    • Second pair: OData escape ('')

     Full Example

    If your Filter Query in Get items is like this:

    title eq '@{items('Apply_to_each')?['Title']}'

    Change to:

    title eq '@{replace(items('Apply_to_each')?['Title'], '''', '''''')}'

    This way:

    • "apple'company" becomes → "apple''company"

    • The OData query is now valid:

      title eq 'apple''company'


    •  

    If I have answered your question, please mark it as the preferred solution ✅ . If you like my response, please give it a Thumbs Up 👍.
    Regards,
    Riyaz

  • KS-29050310-0 Profile Picture
    106 on at
    @Riyaz_riz11 @stampcoin
    Thank you very much. The answers works!

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 519 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 296 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard