Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Answered

Invalid Character in Create File in Sharepoint Document Library

(0) ShareShare
ReportReport
Posted on by

I have a flow that creates a file in a Sharepoint document library on the press of a button. I am trying to test it, but it only can create files that are one folder deep in the document library. Whenever I try to create a file that would be two folders or more deep in the Sharepoint library, it sends back a BadGateway Error. This is what I am attempting to do:

 

error1.PNG

 

And this is the error message that it spits back to me: 

message""BadGateway",
    "innerError": {
      "status"502,
      "message""The file or folder name \"Administration/IT/Dropbox Test /elmo\" contains invalid characters. Please use a different name. Common invalid characters include the following: # % * : < > ? /  |\r\nclientRequestId: 878fb54f-e4f4-47e6-ad9e-bca6afc1db7b\r\nserviceRequestId: 3401979e-7020-6000-d5cf-41c7a2e381d5;3401979e-102e-6000-d5cf-4a5aa3536326",
      "source""https://thecartercenter.sharepoint.com/Administration/IT/_api/web/folders/add(@p)?@p='%2fAdministration%2fIT%2fDropbox+Test+%2felmo'",
      "errors": [
        "-2130575245",
        "Microsoft.SharePoint.SPException"

 

 

For some reason, it seems to be replacing the second folder "/test" with a "\", which then produces an invalid character error. I have replicated this issue with numerous folder names, I have never run into this issue with creating files before, so any help on how to solve this would be greatly appreciated!

  • AA-05082333-0 Profile Picture
    47 on at
    Re: Invalid Character in Create File in Sharepoint Document Library

    Hi,

     

    I seem to have the same issue, and though the flow works fine for some of our users, I noticed it fails intermittently when creating a file in sharepoint for others. From what I have investigated, it seems to be tied to the type of keyboard used. Is there a way I can specify the type of keyboards used to trigger the flow?

    flow fail.jpg

  • v-bacao-msft Profile Picture
    on at
    Re: Invalid Character in Create File in Sharepoint Document Library

    Hi @Anonymous,

     

    Could you please share a full screenshot of the configuration of your flow?

    I did the test on my side, there is no special configuration, it is filled according to the requirements of filed, Folder path is also 2+ subfolders deep.

    But there is no problem you mentioned.

    Image reference:

    3.PNG

    I noticed that the error code is shown as 502.  Since you have no such problem about creating files before, I wonder that the failure may be temporary or transient.

    Please click or tap Resubmit to try the flow again and feel free let me know if issue still exist.

     

    Best Regards,

    Barry

  • Community Power Platform Member Profile Picture
    on at
    Re: Invalid Character in Create File in Sharepoint Document Library

    Thank you for your response, but I don't think that is the issue. I am able to create files directly in the document library ("Dropbox Test") as well as within one subfolder. The error only happens when I am 2+ subfolders deep.

     

    I also tested this on a document library with no spaces in the name, and the error still occurred.

  • Verified answer
    ArmandCronjé Profile Picture
    18 on at
    Re: Invalid Character in Create File in Sharepoint Document Library
    Hi lexiNickens, I've noticed in the folder name "Dropbox Test ", it has a space at the end. What happens if you remove this? I know it is something very small, but in my previous cases with MS that is the first thing they ask you to confirm it doesn't have... Are you able to create a file anywhere else within your document library?

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,631 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,991 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow