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 / SharePoint Create Item...
Power Automate
Unanswered

SharePoint Create Item in list with quotes in Title field?

(0) ShareShare
ReportReport
Posted on by 1,599 Super User 2024 Season 1

Hello,


I am copying items from one list to another and I am seeing this error - this appears to be for items have have quotes in the title field. All items are copying apart from ones that contain ' or ".

Is there any way of combating this without having to remove the quotes from each affected item in the list?

sudosaurus_0-1698400888310.png

 

Categories:
I have the same question (0)
  • SudeepGhatakNZ Profile Picture
    14,394 Most Valuable Professional on at

    Escape the single quote with two single quotes

     

    Title eq 'Sudeep''s car'

     

  • sudosaurus Profile Picture
    1,599 Super User 2024 Season 1 on at

    @SudeepGhatakNZ 

     

    The affected SharePoint item's Title is displayed as:

    sudosaurus_1-1698404689031.png

    I have my get items action formatted as:

    sudosaurus_2-1698405118888.png

     

     

    This is how the Title value is added into the Create item field:

    sudosaurus_3-1698405287101.png

     

     

  • grantjenkins Profile Picture
    11,063 Moderator on at

    For your Get items - OnDomainBC use the following in your Filter Query.

     

    replace(item()?['Title'], '''', '''''')

     

    grantjenkins_0-1698406424998.png

     

    Note that I only had the issue with single quotes in the Title. Double quotes ran fine.

     

    With Create item I can just add the Title with any quotes (single, double) and works successfully.

  • sudosaurus Profile Picture
    1,599 Super User 2024 Season 1 on at

    @grantjenkins - will that work as I'm essentially copying items from one list to another.

     

    Workflow is based on this one: https://powerusers.microsoft.com/t5/Building-Flows/Adding-items-from-source-list-to-destination-list-not-adding/m-p/2420324#M270003

  • grantjenkins Profile Picture
    11,063 Moderator on at

    Yea it should work in that scenario. I'm assuming it's only the Filter Query that's causing you the issues and not the Create item / Update item actions.

  • SudeepGhatakNZ Profile Picture
    14,394 Most Valuable Professional on at

    @sudosaurus 

    1. Get the Title field in a Compose
    2. Replace single quote with two single quotes in an expression
    3. Use the Output of the compose in your Filter Query

    Before that, just hardcode and check if 'SharePoint - How to fix ''Distributed cache''' works.

     

  • sudosaurus Profile Picture
    1,599 Super User 2024 Season 1 on at

    @grantjenkins - it is failing with your method:

    sudosaurus_0-1698410740308.png

     

    {
     "statusCode": 400,
     "headers": {
     "Cache-Control": "max-age=0, private",
     "Vary": "Origin",
     "X-NetworkStatistics": "0,525568,0,0,12,0,17968",
     "X-SharePointHealthScore": "1",
     "X-MS-SPConnector": "1",
     "X-SP-SERVERSTATE": "ReadOnly=0",
     "DATASERVICEVERSION": "3.0",
     "SPClientServiceRequestDuration": "31",
     "SPRequestDuration": "32",
     "X-DataBoundary": "EU",
     "X-1DSCollectorUrl": "https://eu-mobile.events.data.microsoft.com/OneCollector/1.0/",
     "X-AriaCollectorURL": "https://eu-mobile.events.data.microsoft.com/Collector/3.0",
     "SPRequestGuid": "eb526669-3561-48ca-a745-f975fd887027",
     "request-id": "eb526669-3561-48ca-a745-f975fd887027",
     "MS-CV": "aWZS62E1ykinRfl1/YhwJw.0",
     "Strict-Transport-Security": "max-age=31536000",
     "X-Frame-Options": "SAMEORIGIN",
     "Content-Security-Policy": "frame-ancestors 'self' teams.microsoft.com *.teams.microsoft.com *.skype.com *.teams.microsoft.us local.teams.office.com *.powerapps.com *.yammer.com *.officeapps.live.com *.office.com *.microsoft365.com *.stream.azure-test.net *.microsoftstream.com *.dynamics.com *.microsoft.com onedrive.live.com *.onedrive.live.com securebroker.sharepointonline.com;",
     "MicrosoftSharePointTeamServices": "16.0.0.24211",
     "X-Content-Type-Options": "nosniff",
     "X-MS-InvokeApp": "1; RequireReadOnly",
     "P3P": "CP=\"ALL IND DSP COR ADM CONo CUR CUSo IVAo IVDo PSA PSD TAI TELo OUR SAMo CNT COM INT NAV ONL PHY PRE PUR UNI\"",
     "X-AspNet-Version": "4.0.30319",
     "X-Powered-By": "ASP.NET",
     "Timing-Allow-Origin": "*",
     "x-ms-apihub-cached-response": "true",
     "x-ms-apihub-obo": "false",
     "Date": "Fri, 27 Oct 2023 12:42:16 GMT",
     "Content-Length": "246",
     "Content-Type": "application/json",
     "Expires": "Thu, 12 Oct 2023 12:42:16 GMT",
     "Last-Modified": "Fri, 27 Oct 2023 12:42:16 GMT"
     },
     "body": {
     "status": 400,
     "message": "The expression \"How to Shrink SQL Database Log Files\" is not valid. Creating query failed.\r\nclientRequestId: eb526669-3561-48ca-a745-f975fd887027\r\nserviceRequestId: eb526669-3561-48ca-a745-f975fd887027"
     }
    }

     

  • sudosaurus Profile Picture
    1,599 Super User 2024 Season 1 on at

    @SudeepGhatakNZ how would I visually build that out - not fully understanding. Thanks. 

  • grantjenkins Profile Picture
    11,063 Moderator on at

    It looks like you didn't put Title eq 'EXPRESSION'

     

    Title eq '@{replace(item()?['Title'], '''', '''''')}'
  • sudosaurus Profile Picture
    1,599 Super User 2024 Season 1 on at

    @grantjenkins 

     

    So I've done the below but it wouldn't allow me to enter an expression of:

    '@{replace(item()?['Title'], '''', '''''')}'

    I also tried removing the @ and curly braces to no avail.

    sudosaurus_0-1698414187118.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

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

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard