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 / Creating multiple Docu...
Power Automate
Unanswered

Creating multiple Document Libraries through Flow with a single API call

(0) ShareShare
ReportReport
Posted on by 64

Hi,

 

We currently have client SharePoint sites hosted on our O365 tenant, with access to each site to be rolled out to each of our respective clients shortly - I'm currently in the process of trying to automate site creation for any new clients that join us, as previously we've just handled site creation through the GUI and PowerShell. All the sites for the time being will essentially be the same with the same structure, the only difference being the files themselves. I've managed to automate the SharePoint site creation through flow, as well as linking the sites to a hub site, ownership of the sites, group membership, and external access, but I'm having trouble with creating the document libraries on newly created sites. There are 8 libraries overall, and whilst I have actually worked out how to create them each individually using the 'Send a HTTP request to SharePoint" action (I'm quite new to this!), I'd like to try and use MS Graph and JSON batching instead, so I can create all 8 libraries in a single API call.

 

I've tested my JSON on the MS Graph Explorer, which works and and creates the libraries on a specified client site as expected, but when I try and do it through Flow, I get the below error:

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<HTML><HEAD><TITLE>Bad Request</TITLE>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD>
<BODY><h2>Bad Request - Invalid Header</h2>
<hr><p>HTTP Error 400. The request has an invalid header name.</p>
</BODY></HTML>

 

Would anyone be able to tell me where I'm going wrong? I'm assuming it is the Headers, but I'm not sure what the issue is. Do I require an authorization header?

 

See HTTP action below:Doc Lib error.png

 

Any help would be appreciated!

Thank you

 

 

Categories:
I have the same question (0)
  • Verified answer
    PieterVeenstra Profile Picture
    on at

    Hi @Guero ,

     

    Why make things complicated?

     

    I would create an Azure function that applies a PnP template. (https://veenstra.me.uk/2017/05/18/office-365-azure-running-pnp-powershell-using-azure-functions/)

     

    This function you can then call from a flow.

     

     

     

     

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