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 / Invalid Character in C...
Power Automate
Unanswered

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!

Categories:
I have the same question (0)
  • Verified answer
    ArmandCronjé Profile Picture
    18 on at
    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?
  • Community Power Platform Member Profile Picture
    on at

    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.

  • v-bacao-msft Profile Picture
    on at

    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

  • AA-05082333-0 Profile Picture
    47 on at

    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

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